Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoBump] Merge with 1211d979 (Sep 11) (1) #415

Merged
merged 96 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
779a444
[libc] fix tls teardown while being used (#108229)
SchrodingerZhu Sep 11, 2024
fa4a631
[NFC] [HLSL] Update test for HLSL 202x (#108097)
llvm-beanz Sep 11, 2024
d8e124d
[libc] implement vdso (#91572)
SchrodingerZhu Sep 11, 2024
2f321fa
[NFC][clang-tidy] fix tests of deleted functions for missing-std-forw…
5chmidti Sep 11, 2024
866b93e
[RISCV] Don't outline pcrel_lo when the function has a section prefix…
jonathonpenix Sep 11, 2024
415288a
[WebAssembly] Add load and store patterns for V8F16. (#108119)
brendandahl Sep 11, 2024
c076638
[WebAssembly] Support BUILD_VECTOR with F16x8. (#108117)
brendandahl Sep 11, 2024
7721db4
[WebKit Static Analyzer] Treat WTFReportBacktrace as a trivial functi…
rniwa Sep 11, 2024
0d48d4d
[mlir][AMDGPU] Support vector<2xf16> inputs to buffer atomic fadd (#1…
krzysz00 Sep 11, 2024
cb03126
Revert "[mlir][AMDGPU] Support vector<2xf16> inputs to buffer atomic …
krzysz00 Sep 11, 2024
b7b28e7
[NVPTX] Improve copy avoidance during lowering. (#106423)
Artem-B Sep 11, 2024
96b7c64
[LLDB] Reapply SBSaveCore Add Memory List (#107937)
Jlalond Sep 11, 2024
f02c72f
[gn build] Port 96b7c64b8a87
llvmgnsyncbot Sep 11, 2024
943182e
[clang][TableGen] Change comment command emitter to const RecordKeepe…
jurahul Sep 11, 2024
dca9f21
[clang][TableGen] Change HTML Emitter to use const RecordKeeper (#108…
jurahul Sep 11, 2024
e382b0c
[clang][TableGen] Change HTML Tags emitter to use const RecordKeeper …
jurahul Sep 11, 2024
07dc9b8
[clang][TableGen] Change DataCollector to use const RecordKeeper (#10…
jurahul Sep 11, 2024
0767027
[clang][TableGen] Change Opcode Emitter to use const RecordKeeper (#1…
jurahul Sep 11, 2024
7c53a7a
[clang][TableGen] Change OpenCL emitter to use const RecordKeeper (#1…
jurahul Sep 11, 2024
8625eb0
[clang][TableGen] Change OptionDoc Emitter to use const RecordKeeper …
jurahul Sep 11, 2024
1896ee3
[libc] Fix undefined behavior for nan functions. (#106468)
lntue Sep 11, 2024
be770ed
[lld][WebAssembly] Reject shared libraries when `-static`/`-Bstatic` …
sbc100 Sep 11, 2024
e3f936e
Don't rely on undefined behavior to store how a `User` object's alloc…
dpaoliello Sep 11, 2024
666a3f4
[libc] Stub TLS functions on the GPU temporarily (#108267)
jhuber6 Sep 11, 2024
bd4e0df
[SandboxIR][Bench] Benchmark RUOW (#107456)
vporpo Sep 11, 2024
c3d39cb
[ADT][NFC] Constexpr-ify if in DenseMap::clear (#108243)
marcauberer Sep 11, 2024
bbff52b
[libc++] Guard PSTL headers with >= C++17 (#108234)
ldionne Sep 11, 2024
118f120
[libc++] Get rid of experimental/__config (#108233)
ldionne Sep 11, 2024
882f21e
[WebKit Checkers] Allow "singleton" suffix to be camelCased. (#108257)
rniwa Sep 11, 2024
aabb012
[mlir][bufferization] Fix OpFilter::denyDialect (#108249)
mfrancio Sep 11, 2024
b06954a
[alpha.webkit.UncountedCallArgsChecker] Allow protector functions in …
rniwa Sep 11, 2024
0cfa5ab
[SandboxIR][Bench] Add tests with tracking enabled (#108273)
vporpo Sep 11, 2024
4570984
builtins: honour `_M_ARM64` as `__aarch64__`
compnerd Sep 11, 2024
108ed9d
[flang] Remove a leftover debugging message. (#108175)
abidh Sep 11, 2024
c31d343
Update legalizations for LowerGpuOpsToROCDLOps (#108266)
nirvedhmeshram Sep 11, 2024
b8239e1
[HLSL] Add StructuredBuffer to external sema source (#106316)
bob80905 Sep 11, 2024
ea83e1c
[LV] Assign cost to all interleave members when not interleaving.
fhahn Sep 11, 2024
956591b
[SandboxIR] Add remaining SelectInst methods and track swapValues() (…
slackito Sep 11, 2024
b3f3c0c
[clang][AArch64] Put soft-float ABI checks under isSoftFloat(). NFC
jroelofs Sep 11, 2024
9c0ba62
[ctx_prof] Relax the "profile use" case around `PGOOpt` (#108265)
mtrofin Sep 11, 2024
c2b93e0
update llvm-dis header with available options (#108073)
txff99 Sep 11, 2024
5c7957d
[AArch64] Allow i16->f64 uitofp tbl shuffles
davemgreen Sep 11, 2024
63d8bd2
[scudo] Add thread-safety annotation on getMemoryGroupFragmentationIn…
ChiaHungDuan Sep 11, 2024
60efbe9
[NFC][rtsan] Docs of how to disable rtsan (#107707)
cjappl Sep 11, 2024
54c6e1c
[SLP] Move a non-power-of-two bailout down slightly
preames Sep 11, 2024
ec7c8cd
[compiler-rt][NFC] Add preprocessor definitions for 64 bit file inter…
cjappl Sep 11, 2024
4618b67
[libc][bazel] Enable epoll_pwait2 on bazel (#108254)
michaelrj-google Sep 11, 2024
a66ce58
[BOLT] Drop suffixes in parsePseudoProbe GUID assignment (#106243)
aaupov Sep 11, 2024
1797174
[NFC][sanitizer] Commit test for #106912 (#108289)
vitalybuka Sep 11, 2024
3a0ef2a
[libc++] Reland LWG2921 and LWG2976 (#107960)
frederick-vs-ja Sep 11, 2024
695cb55
[libc++] Remove obsolete header restrictions for _LIBCPP_HAS_NO_THREA…
ldionne Sep 11, 2024
a858836
[clangl[TableGen] Change Diagnostic Emitter to use const RecordKeeper…
jurahul Sep 11, 2024
a29afb7
[HLSL] Allow truncation to scalar (#104844)
llvm-beanz Sep 11, 2024
07a7bdc
[WebAssembly] Fix lane index size for f16x8 extract_lane. (#108118)
brendandahl Sep 11, 2024
31d4837
[SandboxIR][Bench] SandboxIR creation (#108278)
vporpo Sep 11, 2024
c98d6c2
[NFC] Reformat ClangASTPropertiesEmitter `ASTPropsEmitter` class (#10…
jurahul Sep 11, 2024
0601370
Reapply "[Clang][CWG1815] Support lifetime extension of temporary cre…
yronglin Sep 11, 2024
0909e30
[lldb] Skip checksum-mismatch.test on Windows
JDevlieghere Sep 11, 2024
ae0ed3d
[lsan] Fix free(NULL) interception during initialization (#106912)
tmiasko Sep 11, 2024
2a9208b
[WebAssembly] Change F16x8 extract lane to require constant integer. …
brendandahl Sep 11, 2024
b5fd946
[HIP][Clang][CodeGen] Handle hip bin symbols properly. (#107458)
jofrn Sep 11, 2024
7910812
[SLP] Regen a test to pick up naming changes
preames Sep 11, 2024
aa60a3e
[mlir][AMDGPU] Support vector<2xf16> inputs to buffer atomic fadd (#1…
krzysz00 Sep 11, 2024
fa8b737
[SLP][RISCV] Add test for 3 element build vector feeding reduce
preames Sep 11, 2024
d32982b
[HLSL] fix elementwise bitreverse test (#108128)
spall Sep 11, 2024
6e4dcbb
[clang][deps] Print tracing VFS data (#108056)
jansvoboda11 Sep 11, 2024
1b3e64a
[RISCV][TTI] Add vp.cmp intrinsic cost with functionalOPC. (#107504)
ElvisWang123 Sep 11, 2024
b690cae
Update StructuredBuffer-AST test after removal of HLSLResourceClassAt…
bob80905 Sep 11, 2024
93e45a6
[Dexter] Adapt to upcoming lldb stepping behavior (#108127)
jasonmolenda Sep 11, 2024
34e20f1
[DirectX] Implement typedBufferLoad_checkbit (#108087)
bogner Sep 11, 2024
c820bd3
[BOLT][NFC] Rename profile-use-pseudo-probes
aaupov Sep 11, 2024
86ec59e
[BOLT] Only parse probes for profiled functions in profile-write-pseu…
aaupov Sep 11, 2024
ccc7a07
[BOLT] Drop blocks without profile in BAT YAML (#107970)
aaupov Sep 11, 2024
8287831
Reland "[llvm-lit] Process ANSI color codes in test output when forma…
hnrklssn Sep 11, 2024
3cd0137
Revert "[RFC][C++20][Modules] Fix crash when function and lambda insi…
pranavk Sep 12, 2024
480f07f
[RISCV] Add fixed length vector patterns for vfwmaccbf16.vv (#108204)
lukel97 Sep 12, 2024
44d1221
[RISCV] Expand bf16 vector truncstores and extloads (#108235)
lukel97 Sep 12, 2024
1a431bc
[mlir][Tosa] Fix attr type of out_shape for `tosa.transpose_conv2d` (…
CoTinker Sep 12, 2024
757d8b3
[RISCV] Allow -mcmodel= to accept large for RV64 (#107817)
tclin914 Sep 12, 2024
3d12901
[DirectX] Preserve value names in DXILOpLowering. NFC (#108089)
bogner Sep 12, 2024
39751e7
[clang-tidy][NFC] fix add_new_check python3.8 incompatibility (#107871)
HerrCai0907 Sep 12, 2024
c9ab697
[SandboxIR] Implement ConstantTokenNone (#108106)
vporpo Sep 12, 2024
2d4bdfb
[mlir][scf] Extend consumer fuse to single nested `scf.for` (#94190)
Yun-Fly Sep 12, 2024
335538c
Revert "[mlir][scf] Extend consumer fuse to single nested `scf.for` (…
kazutakahirata Sep 12, 2024
8168088
[clang-format] Fix regressions in BAS_AlwaysBreak (#107506)
owenca Sep 12, 2024
5e80fc8
[opt] Fix opt for LLVM_ENABLE_EXPORTED_SYMBOLS_IN_EXECUTABLES=Off.
lhames Sep 12, 2024
2740273
[MLIR][Presburger] Make printing aligned to assist in debugging (#107…
kaitingwang Sep 12, 2024
9469836
[clang-format][NFC] Minor clean of TokenAnnotatorTest
owenca Sep 12, 2024
ded0801
[libc] Add osutils for Windows and make libc and its tests build on W…
Lancern Sep 12, 2024
b7167c7
[mlir] Fix incorrect comparison due to -Wtautological-constant-out-of…
DamonFool Sep 12, 2024
a9ba1b6
[mlir][scf] Extend consumer fuse to single nested `scf.for` (#108318)
Yun-Fly Sep 12, 2024
08740a6
[CodeGen] Fix documentation for ISD::ATOMIC_STORE. NFC (#108126)
peilin-ye Sep 12, 2024
8c17ed1
[RISCV] Generalize RISCVDAGToDAGISel::selectFPImm to handle bitcasts …
topperc Sep 12, 2024
1211d97
[X86] Use SWAR techniques for some vector i8 shifts
majnemer Sep 12, 2024
ad9406e
[AutoBump] Merge with 1211d979 (Sep 11)
jorickert Dec 12, 2024
45e07e7
Fix format
jorickert Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions bolt/include/bolt/Utils/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ std::string getEscapedName(const StringRef &Name);
/// Return the unescaped name
std::string getUnescapedName(const StringRef &Name);

/// Return a common part for a given \p Name wrt a given \p Suffixes list.
/// Preserve the suffix if \p KeepSuffix is set, only dropping characters
/// following it, otherwise drop the suffix as well.
std::optional<StringRef> getCommonName(const StringRef Name, bool KeepSuffix,
ArrayRef<StringRef> Suffixes);
/// LTO-generated function names take a form:
///
/// <function_name>.lto_priv.<decimal_number>/...
Expand Down
18 changes: 11 additions & 7 deletions bolt/lib/Profile/DataAggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ MaxSamples("max-samples",
cl::cat(AggregatorCategory));

extern cl::opt<opts::ProfileFormatKind> ProfileFormat;
extern cl::opt<bool> ProfileUsePseudoProbes;
extern cl::opt<bool> ProfileWritePseudoProbes;
extern cl::opt<std::string> SaveProfile;

cl::opt<bool> ReadPreAggregated(
Expand Down Expand Up @@ -2300,7 +2300,7 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
yaml::bolt::BinaryProfile BP;

const MCPseudoProbeDecoder *PseudoProbeDecoder =
opts::ProfileUsePseudoProbes ? BC.getPseudoProbeDecoder() : nullptr;
opts::ProfileWritePseudoProbes ? BC.getPseudoProbeDecoder() : nullptr;

// Fill out the header info.
BP.Header.Version = 1;
Expand Down Expand Up @@ -2427,11 +2427,15 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
}
}
}
// Drop blocks without a hash, won't be useful for stale matching.
llvm::erase_if(YamlBF.Blocks,
[](const yaml::bolt::BinaryBasicBlockProfile &YamlBB) {
return YamlBB.Hash == (yaml::Hex64)0;
});
// Skip printing if there's no profile data
llvm::erase_if(
YamlBF.Blocks, [](const yaml::bolt::BinaryBasicBlockProfile &YamlBB) {
auto HasCount = [](const auto &SI) { return SI.Count; };
bool HasAnyCount = YamlBB.ExecCount ||
llvm::any_of(YamlBB.Successors, HasCount) ||
llvm::any_of(YamlBB.CallSites, HasCount);
return !HasAnyCount;
});
BP.Functions.emplace_back(YamlBF);
}
}
Expand Down
5 changes: 0 additions & 5 deletions bolt/lib/Profile/YAMLProfileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ llvm::cl::opt<bool>
llvm::cl::opt<bool> ProfileUseDFS("profile-use-dfs",
cl::desc("use DFS order for YAML profile"),
cl::Hidden, cl::cat(BoltOptCategory));

llvm::cl::opt<bool> ProfileUsePseudoProbes(
"profile-use-pseudo-probes",
cl::desc("Use pseudo probes for profile generation and matching"),
cl::Hidden, cl::cat(BoltOptCategory));
} // namespace opts

namespace llvm {
Expand Down
11 changes: 8 additions & 3 deletions bolt/lib/Profile/YAMLProfileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "bolt/Profile/DataAggregator.h"
#include "bolt/Profile/ProfileReaderBase.h"
#include "bolt/Rewrite/RewriteInstance.h"
#include "bolt/Utils/CommandLineOpts.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/raw_ostream.h"
Expand All @@ -21,8 +22,12 @@
#define DEBUG_TYPE "bolt-prof"

namespace opts {
extern llvm::cl::opt<bool> ProfileUseDFS;
extern llvm::cl::opt<bool> ProfileUsePseudoProbes;
using namespace llvm;
extern cl::opt<bool> ProfileUseDFS;
cl::opt<bool> ProfileWritePseudoProbes(
"profile-write-pseudo-probes",
cl::desc("Use pseudo probes in profile generation"), cl::Hidden,
cl::cat(BoltOptCategory));
} // namespace opts

namespace llvm {
Expand Down Expand Up @@ -59,7 +64,7 @@ YAMLProfileWriter::convert(const BinaryFunction &BF, bool UseDFS,
yaml::bolt::BinaryFunctionProfile YamlBF;
const BinaryContext &BC = BF.getBinaryContext();
const MCPseudoProbeDecoder *PseudoProbeDecoder =
opts::ProfileUsePseudoProbes ? BC.getPseudoProbeDecoder() : nullptr;
opts::ProfileWritePseudoProbes ? BC.getPseudoProbeDecoder() : nullptr;

const uint16_t LBRProfile = BF.getProfileFlags() & BinaryFunction::PF_LBR;

Expand Down
56 changes: 41 additions & 15 deletions bolt/lib/Rewrite/PseudoProbeRewriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "bolt/Rewrite/MetadataRewriter.h"
#include "bolt/Rewrite/MetadataRewriters.h"
#include "bolt/Utils/CommandLineOpts.h"
#include "bolt/Utils/Utils.h"
#include "llvm/IR/Function.h"
#include "llvm/MC/MCPseudoProbe.h"
#include "llvm/Support/CommandLine.h"
Expand Down Expand Up @@ -49,7 +50,7 @@ static cl::opt<PrintPseudoProbesOptions> PrintPseudoProbes(
clEnumValN(PPP_All, "all", "enable all debugging printout")),
cl::Hidden, cl::cat(BoltCategory));

extern cl::opt<bool> ProfileUsePseudoProbes;
extern cl::opt<bool> ProfileWritePseudoProbes;
} // namespace opts

namespace {
Expand All @@ -71,7 +72,8 @@ class PseudoProbeRewriter final : public MetadataRewriter {

/// Parse .pseudo_probe_desc section and .pseudo_probe section
/// Setup Pseudo probe decoder
void parsePseudoProbe();
/// If \p ProfiledOnly is set, only parse records for functions with profile.
void parsePseudoProbe(bool ProfiledOnly = false);

/// PseudoProbe decoder
std::shared_ptr<MCPseudoProbeDecoder> ProbeDecoderPtr;
Expand All @@ -90,21 +92,21 @@ class PseudoProbeRewriter final : public MetadataRewriter {
};

Error PseudoProbeRewriter::preCFGInitializer() {
if (opts::ProfileUsePseudoProbes)
parsePseudoProbe();
if (opts::ProfileWritePseudoProbes)
parsePseudoProbe(true);

return Error::success();
}

Error PseudoProbeRewriter::postEmitFinalizer() {
if (!opts::ProfileUsePseudoProbes)
if (!opts::ProfileWritePseudoProbes)
parsePseudoProbe();
updatePseudoProbes();

return Error::success();
}

void PseudoProbeRewriter::parsePseudoProbe() {
void PseudoProbeRewriter::parsePseudoProbe(bool ProfiledOnly) {
MCPseudoProbeDecoder &ProbeDecoder(*ProbeDecoderPtr);
PseudoProbeDescSection = BC.getUniqueSectionByName(".pseudo_probe_desc");
PseudoProbeSection = BC.getUniqueSectionByName(".pseudo_probe");
Expand Down Expand Up @@ -133,10 +135,22 @@ void PseudoProbeRewriter::parsePseudoProbe() {

MCPseudoProbeDecoder::Uint64Set GuidFilter;
MCPseudoProbeDecoder::Uint64Map FuncStartAddrs;
SmallVector<StringRef, 0> Suffixes(
{".destroy", ".resume", ".llvm.", ".cold", ".warm"});
for (const BinaryFunction *F : BC.getAllBinaryFunctions()) {
bool HasProfile = F->hasProfileAvailable();
for (const MCSymbol *Sym : F->getSymbols()) {
FuncStartAddrs[Function::getGUID(NameResolver::restore(Sym->getName()))] =
F->getAddress();
StringRef SymName = Sym->getName();
for (auto Name : {std::optional(NameResolver::restore(SymName)),
getCommonName(SymName, false, Suffixes)}) {
if (!Name)
continue;
SymName = *Name;
uint64_t GUID = Function::getGUID(SymName);
FuncStartAddrs[GUID] = F->getAddress();
if (ProfiledOnly && HasProfile)
GuidFilter.insert(GUID);
}
}
}
Contents = PseudoProbeSection->getContents();
Expand All @@ -155,13 +169,25 @@ void PseudoProbeRewriter::parsePseudoProbe() {
ProbeDecoder.printProbesForAllAddresses(outs());
}

for (const auto &FuncDesc : ProbeDecoder.getGUID2FuncDescMap()) {
uint64_t GUID = FuncDesc.FuncGUID;
if (!FuncStartAddrs.contains(GUID))
continue;
BinaryFunction *BF = BC.getBinaryFunctionAtAddress(FuncStartAddrs[GUID]);
assert(BF);
BF->setGUID(GUID);
const GUIDProbeFunctionMap &GUID2Func = ProbeDecoder.getGUID2FuncDescMap();
// Checks GUID in GUID2Func and returns it if it's present or null otherwise.
auto checkGUID = [&](StringRef SymName) -> uint64_t {
uint64_t GUID = Function::getGUID(SymName);
if (GUID2Func.find(GUID) == GUID2Func.end())
return 0;
return GUID;
};
for (BinaryFunction *F : BC.getAllBinaryFunctions()) {
for (const MCSymbol *Sym : F->getSymbols()) {
StringRef SymName = NameResolver::restore(Sym->getName());
uint64_t GUID = checkGUID(SymName);
std::optional<StringRef> CommonName =
getCommonName(SymName, false, Suffixes);
if (!GUID && CommonName)
GUID = checkGUID(*CommonName);
if (GUID)
F->setGUID(GUID);
}
}
}

Expand Down
12 changes: 9 additions & 3 deletions bolt/lib/Utils/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,21 @@ std::string getUnescapedName(const StringRef &Name) {
return Output;
}

std::optional<StringRef> getLTOCommonName(const StringRef Name) {
for (StringRef Suffix : {".__uniq.", ".lto_priv.", ".constprop.", ".llvm."}) {
std::optional<StringRef> getCommonName(const StringRef Name, bool KeepSuffix,
ArrayRef<StringRef> Suffixes) {
for (StringRef Suffix : Suffixes) {
size_t LTOSuffixPos = Name.find(Suffix);
if (LTOSuffixPos != StringRef::npos)
return Name.substr(0, LTOSuffixPos + Suffix.size());
return Name.substr(0, LTOSuffixPos + (KeepSuffix ? Suffix.size() : 0));
}
return std::nullopt;
}

std::optional<StringRef> getLTOCommonName(const StringRef Name) {
return getCommonName(Name, true,
{".__uniq.", ".lto_priv.", ".constprop.", ".llvm."});
}

std::optional<uint8_t> readDWARFExpressionTargetReg(StringRef ExprBytes) {
uint8_t Opcode = ExprBytes[0];
if (Opcode == dwarf::DW_CFA_def_cfa_expression)
Expand Down
6 changes: 3 additions & 3 deletions bolt/test/X86/pseudoprobe-decoding-inline.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# PREAGG: B X:0 #main# 1 0
## Check pseudo-probes in regular YAML profile (non-BOLTed binary)
# RUN: link_fdata %s %S/../../../llvm/test/tools/llvm-profgen/Inputs/inline-cs-pseudoprobe.perfbin %t.preagg PREAGG
# RUN: perf2bolt %S/../../../llvm/test/tools/llvm-profgen/Inputs/inline-cs-pseudoprobe.perfbin -p %t.preagg --pa -w %t.yaml -o %t.fdata --profile-use-pseudo-probes
# RUN: perf2bolt %S/../../../llvm/test/tools/llvm-profgen/Inputs/inline-cs-pseudoprobe.perfbin -p %t.preagg --pa -w %t.yaml -o %t.fdata --profile-write-pseudo-probes
# RUN: FileCheck --input-file %t.yaml %s --check-prefix CHECK-YAML
## Check pseudo-probes in BAT YAML profile (BOLTed binary)
# RUN: link_fdata %s %t.bolt %t.preagg2 PREAGG
# RUN: perf2bolt %t.bolt -p %t.preagg2 --pa -w %t.yaml2 -o %t.fdata2 --profile-use-pseudo-probes
# RUN: perf2bolt %t.bolt -p %t.preagg2 --pa -w %t.yaml2 -o %t.fdata2 --profile-write-pseudo-probes
# RUN: FileCheck --input-file %t.yaml2 %s --check-prefix CHECK-YAML
# CHECK-YAML: name: bar
# CHECK-YAML: - bid: 0
Expand All @@ -30,7 +30,7 @@
# CHECK-YAML: guid: 0xDB956436E78DD5FA
# CHECK-YAML: pseudo_probe_desc_hash: 0x10000FFFFFFFF
#
## Check that without --profile-use-pseudo-probes option, no pseudo probes are
## Check that without --profile-write-pseudo-probes option, no pseudo probes are
## generated
# RUN: perf2bolt %S/../../../llvm/test/tools/llvm-profgen/Inputs/inline-cs-pseudoprobe.perfbin -p %t.preagg --pa -w %t.yaml -o %t.fdata
# RUN: FileCheck --input-file %t.yaml %s --check-prefix CHECK-NO-OPT
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/clang-tidy/add_new_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import textwrap

# FIXME Python 3.9: Replace typing.Tuple with builtins.tuple.
from typing import Optional, Tuple
from typing import Optional, Tuple, Match


# Adapts the module's CMakelist file. Returns 'True' if it could add a new
Expand Down Expand Up @@ -511,7 +511,7 @@ def has_auto_fix(check_name: str) -> str:

return ""

def process_doc(doc_file: Tuple[str, str]) -> Tuple[str, Optional[re.Match[str]]]:
def process_doc(doc_file: Tuple[str, str]) -> Tuple[str, Optional[Match[str]]]:
check_name = doc_file[0] + "-" + doc_file[1].replace(".rst", "")

with io.open(os.path.join(docs_dir, *doc_file), "r", encoding="utf8") as doc:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ void lambda_value_reference_auxiliary_var(T&& t) {
namespace deleted_functions {

template <typename T>
void f(T &&) = delete;
void f(T &&t) = delete;

struct S {
template <typename T>
S(T &&) = delete;
S(T &&t) = delete;

template <typename T>
void operator&(T &&) = delete;
void operator&(T &&t) = delete;
};

} // namespace deleted_functions
Expand Down
50 changes: 50 additions & 0 deletions clang/docs/RealtimeSanitizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,53 @@ non-zero exit code.
#13 0x00010230dd64 in main main.cpp:9
#14 0x0001958960dc (<unknown module>)
#15 0x2f557ffffffffffc (<unknown module>)

Disabling
---------

In some circumstances, you may want to suppress error reporting in a specific scope.

In C++, this is achieved via ``__rtsan::ScopedDisabler``. Within the scope where the ``ScopedDisabler`` object is instantiated, all sanitizer error reports are suppressed. This suppression applies to the current scope as well as all invoked functions, including any functions called transitively.

.. code-block:: c++

#include <sanitizer/rtsan_interface.h>

void process(const std::vector<float>& buffer) [[clang::nonblocking]] {
{
__rtsan::ScopedDisabler d;
...
}
}

If RealtimeSanitizer is not enabled at compile time (i.e., the code is not compiled with the ``-fsanitize=realtime`` flag), the ``ScopedDisabler`` is compiled as a no-op.

In C, you can use the ``__rtsan_disable()`` and ``rtsan_enable()`` functions to manually disable and re-enable RealtimeSanitizer checks.

.. code-block:: c++

#include <sanitizer/rtsan_interface.h>

int process(const float* buffer) [[clang::nonblocking]]
{
{
__rtsan_disable();

...

__rtsan_enable();
}
}

Each call to ``__rtsan_disable()`` must be paired with a subsequent call to ``__rtsan_enable()`` to restore normal sanitizer functionality. If a corresponding ``rtsan_enable()`` call is not made, the behavior is undefined.

Compile-time sanitizer detection
--------------------------------

Clang provides the pre-processor macro ``__has_feature`` which may be used to detect if RealtimeSanitizer is enabled at compile-time.

.. code-block:: c++

#if defined(__has_feature) && __has_feature(realtime_sanitizer)
...
#endif
5 changes: 5 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ C++ Language Changes
- Allow single element access of GCC vector/ext_vector_type object to be
constant expression. Supports the `V.xyzw` syntax and other tidbits
as seen in OpenCL. Selecting multiple elements is left as a future work.
- Implement `CWG1815 <https://wg21.link/CWG1815>`_. Support lifetime extension
of temporary created by aggregate initialization using a default member
initializer.

- Accept C++26 user-defined ``static_assert`` messages in C++11 as an extension.

Expand Down Expand Up @@ -457,6 +460,8 @@ LoongArch Support
RISC-V Support
^^^^^^^^^^^^^^

- The option ``-mcmodel=large`` for the large code model is supported.

CUDA/HIP Language Changes
^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
4 changes: 2 additions & 2 deletions clang/include/clang/Basic/BuiltinsWebAssembly.def
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ TARGET_BUILTIN(__builtin_wasm_relaxed_dot_bf16x8_add_f32_f32x4, "V4fV8UsV8UsV4f"
TARGET_BUILTIN(__builtin_wasm_loadf16_f32, "fh*", "nU", "fp16")
TARGET_BUILTIN(__builtin_wasm_storef16_f32, "vfh*", "n", "fp16")
TARGET_BUILTIN(__builtin_wasm_splat_f16x8, "V8hf", "nc", "fp16")
TARGET_BUILTIN(__builtin_wasm_extract_lane_f16x8, "fV8hi", "nc", "fp16")
TARGET_BUILTIN(__builtin_wasm_replace_lane_f16x8, "V8hV8hif", "nc", "fp16")
TARGET_BUILTIN(__builtin_wasm_extract_lane_f16x8, "fV8hIi", "nc", "fp16")
TARGET_BUILTIN(__builtin_wasm_replace_lane_f16x8, "V8hV8hIif", "nc", "fp16")

// Reference Types builtins
// Some builtins are custom type-checked - see 't' as part of the third argument,
Expand Down
7 changes: 0 additions & 7 deletions clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -10162,13 +10162,6 @@ def warn_dangling_pointer_assignment : Warning<
"will be destroyed at the end of the full-expression">,
InGroup<DanglingAssignment>;

def warn_unsupported_lifetime_extension : Warning<
"lifetime extension of "
"%select{temporary|backing array of initializer list}0 created "
"by aggregate initialization using a default member initializer "
"is not yet supported; lifetime of %select{temporary|backing array}0 "
"will end at the end of the full-expression">, InGroup<Dangling>;

// For non-floating point, expressions of the form x == x or x != x
// should result in a warning, since these always evaluate to a constant.
// Array comparisons have similar warnings
Expand Down
Loading
Loading