Skip to content

[clang][analyzer] fix false positive of BlockInCriticalSectionChecker #126752

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

Closed
wants to merge 263 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
263 commits
Select commit Hold shift + click to select a range
404ceb9
[Vectorize] Avoid repeated hash lookups (NFC) (#126681)
kazutakahirata Feb 11, 2025
044d916
[ValueTracking] Handle trunc to i1 as condition in dominating conditi…
andjo403 Feb 11, 2025
51340ca
[Clang][Driver][HIP] Fix test for HIP as it was failing (#126585)
Sharjeel-Khan Feb 11, 2025
4245955
[flang][acc] Fill-in name for privatized loop iv (#126601)
razvanlupusoru Feb 11, 2025
8921bf1
[clang][Sema] Move computing enum bits into a separate function (#126…
kuilpd Feb 11, 2025
e99e45b
[GitHub] Add aaronmondal to Bazel codeowners (#126760)
aaronmondal Feb 11, 2025
8607b92
[HLSL] Appropriately set function attribute optnone (#125937)
bharadwajy Feb 11, 2025
e929fba
[libc][test][stdbit] fix -Wimplicit-int-conversion (#126616)
nickdesaulniers Feb 11, 2025
edc7cbf
[Release Notes] Mention -fprofile-continuous in release notes
Feb 11, 2025
1e002aa
[analyzer][docs] Document how to use perf and uftrace to debug perfor…
steakhal Feb 11, 2025
5f1f59a
[GitHub] Skip undefcheck if no relevant files changed (#126749)
aaronmondal Feb 11, 2025
80d1b8c
[lldb] Devirtualize GetValueProperties (NFC) (#126583)
JDevlieghere Feb 11, 2025
bf768fa
[WebKit Checkers] Treat const Objective-C ivar as a safe origin (#126…
rniwa Feb 11, 2025
f42e757
AMDGPU: Handle gfx950 XDL-write-VGPR-VALU-Mem-Exp wait state change (…
VigneshwarJ Feb 11, 2025
d7ebf28
AMDGPU: Handle gfx950 XDL Write-VGPR-VALU-WAW wait state change (#126…
VigneshwarJ Feb 11, 2025
d387030
[llvm] Avoid out-of-order evaluation in DebugInfo (#125116)
elvinw-intel Feb 11, 2025
e3001ae
[flang][NFCI] Stop tracking memory source after a load in a more expl…
Renaud-K Feb 11, 2025
4d59b49
[Clang] [OpenMP] Add support for '#pragma omp stripe'. (#119891)
zahiraam Feb 11, 2025
e9a950c
[mlir][tosa] Change the shift of mul to be required (#125297)
Tai78641 Feb 11, 2025
04afd3d
[WebKit Checkers] Allow operator T&() in a const member function (#12…
rniwa Feb 11, 2025
18c0d85
[libc++] Fixes building with Python 3.8.
mordante Feb 11, 2025
1d7f11b
[Hexagon][Disassembler] Set CommentStream of Disassembler (#126766)
quic-areg Feb 11, 2025
6679b18
[flang][rt] Add decimal files to device runtime (#126778)
clementval Feb 11, 2025
a3b8829
[clang-linker-wrapper][lit] Fix SPIR-V ELF test when spirv-tools feat…
sarnex Feb 11, 2025
bd543c0
[MLIR] Make generated markdown doc more consistent (#119926)
GleasonK Feb 11, 2025
53ba8fc
Revert "[Clang] [OpenMP] Add support for '#pragma omp stripe'. (#1198…
kazutakahirata Feb 11, 2025
5157425
[DAG] Use ArrayRef to simplify ShuffleVectorSDNode::isSplatMask
preames Feb 11, 2025
1b38733
[Offload] Properly guard modifications to the RPC device array (#126790)
jhuber6 Feb 11, 2025
3d94088
[AArch64] Add a phase-order test for dot patterns. NFC
davemgreen Feb 11, 2025
4705987
[NFC] [clang] fix unused variable warning (#126796)
fmayer Feb 11, 2025
efa1101
[DependenceAnalysis][NFC] Removing PossiblyLoopIndependent parameter …
1997alireza Feb 11, 2025
2c0c71a
[RISCV] Add coverage for vmerge.vim shuffle lowering
preames Feb 11, 2025
2fb80ce
[clang] Assert the enum FPOpts and LangOpts fit into the storage (#12…
fmayer Feb 11, 2025
672a21a
[mlir][vector][nfc] Add clarification on "dim-1" bcast (#125425)
banach-space Feb 11, 2025
406064c
[SLP]Fix attempt to build the reorder mask for non-adjusted reuse mask
alexey-bataev Feb 11, 2025
77d7645
[NFC] [clang] Use isa instead of dyn_cast
fmayer Feb 11, 2025
b351873
[SandboxVec][Scheduler] Update ready list comparator (#126160)
vporpo Feb 11, 2025
7416711
[mlir] Silence -Wdangling-assignment-gsl in OperationSupport.h (#126140)
smeenai Feb 11, 2025
5a997d5
[libc][docgen] make note of sys/time.h interfaces removed in POSIX.1-…
nickdesaulniers Feb 11, 2025
6968f3e
[clang][HeuristicResolver] Track the expression whose type is being s…
HighCommander4 Feb 11, 2025
de7826e
[libc][math] Add float-only option for atan2f. (#122979)
lntue Feb 11, 2025
8bd8f5c
[AMDGPU][True16][CodeGen] true16 codegen for MadFmaMixPat (#124892)
broxigarchen Feb 11, 2025
973f013
[libc] create TimeReader to look at a struct tm (#126138)
michaelrj-google Feb 11, 2025
4e38ed5
[RISCV] Decompose single source shuffles (without exact VLEN) (#126108)
preames Feb 11, 2025
d9e66ab
[ORC] Switch to singleton pattern for UnwindInfoManager. (#126691)
lhames Feb 11, 2025
def306d
Revert "[mlir] Silence -Wdangling-assignment-gsl in OperationSupport.…
smeenai Feb 11, 2025
5dba28e
[CFIFixup] Fixup CFI for split functions with synchronous uwtables (#…
dhoekwater Feb 11, 2025
d7fe304
[libc][NFC] Remove DEFAULT_DOUBLE_SPLIT macro. (#126822)
lntue Feb 11, 2025
6dca4ec
[NFC] [clang] fixed unused variable warning
fmayer Feb 11, 2025
fe97f1b
[RISCV] Allow undef prefix for local repeating VLA shuffle lowering (…
preames Feb 11, 2025
9f107b4
[NVPTX] Lower invalid `ISD::ADDRSPACECAST` (#125607)
justinfargnoli Feb 11, 2025
a1474cb
Revert "[RISCV] Allow undef prefix for local repeating VLA shuffle lo…
preames Feb 11, 2025
769a916
[mlir] Enable LICM for ops with only read side effects in scf.for (#1…
ardaunal Feb 11, 2025
831dab1
[ExecutionEngine] Fix a warning
kazutakahirata Feb 11, 2025
3008086
[ExecutionEngine] Fix formatting (NFC)
kazutakahirata Feb 12, 2025
195da3d
[libc] fix get_epoch constexpr error (#126818)
michaelrj-google Feb 12, 2025
6e542c6
[LowerBufferFatPointers] Fix support for GEP T, p7, <N x T> idxs (#12…
krzysz00 Feb 12, 2025
77e3656
[scudo] Modify header corrupption error message (#126812)
cferris1000 Feb 12, 2025
464bf26
[mlir] [DataFlow] Fix bug in int-range-analysis (#126708)
cxy-1993 Feb 12, 2025
b252de4
[mlir][vector][NFC] Fix typos in tests (#126662)
linuxlonelyeagle Feb 12, 2025
2df73fb
[libc] implement endian related macros (#126368)
c8ef Feb 12, 2025
cf7c8e7
[msan] Add handlePairwiseShadowOrIntrinsic and use it to handle Arm N…
thurstond Feb 12, 2025
bfa8acf
[MemorySanitizer] Silence an unused-variable warning (NFC)
DamonFool Feb 12, 2025
be34333
[Clang][CMake][MSVC] Install PDBs alongside executables (#126675)
mayanez Feb 12, 2025
10d6057
[RISCV] Select mask operands as virtual registers and eliminate uses …
lukel97 Feb 12, 2025
40860cb
Revert "[mlir] Enable LICM for ops with only read side effects in scf…
htyu Feb 12, 2025
32942c0
[gn build] Port cc7e83601d75
llvmgnsyncbot Feb 12, 2025
7ee8958
[DAGCombiner] Add hasOneUse checks for folding (not (add X, -1)) to (…
tclin914 Feb 12, 2025
b968813
[MC] Use `std::move` to avoid copy (#126700)
abhishek-kaushik22 Feb 12, 2025
d8b2181
[RISCV] Fix a warning
kazutakahirata Feb 12, 2025
d03080a
[PGO][Offload] Profile profraw generation for GPU instrumentation #7…
EthanLuisMcDonough Feb 12, 2025
76bb67a
[AMDGPU][NewPM] Port "GCNRewritePartialRegUses" pass to NPM (#126024)
vikramRH Feb 12, 2025
ccb3f7b
[AsmParser] Remove OperandMatchResultTy (#126650)
lenary Feb 12, 2025
8104d41
[MC] Replace MCContext::GenericSectionID with MCSection::NonUniqueID …
HaohaiWen Feb 12, 2025
6dc8a9a
[PGO][Offload] Fix pgo1.c (#126864)
EthanLuisMcDonough Feb 12, 2025
7836801
AMDGPU: Use range to implement getSubRegs (#126861)
arsenm Feb 12, 2025
ee99f56
[NFC][Pipelines] Extract buildCoroConditionalWrapper (#126860)
vitalybuka Feb 12, 2025
26038e3
[clang-format][NFC] Fix test case format
owenca Feb 12, 2025
232b002
[SelectionDAGBuilder] Remove NodeMap updates from getValueImpl. NFC (…
topperc Feb 12, 2025
300a9b6
Reapply "[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP."…
ampandey-1995 Feb 12, 2025
edcfdcf
[mlir][dlti] Query by strings (#126716)
adam-smnk Feb 12, 2025
0b11c4b
[NVPTX] Cleanup/Refactoring in NVPTX AsmPrinter and RegisterInfo (NFC…
AlexMaclean Feb 12, 2025
3937ea2
[BOLT] Use getMainExecutable() (#126698)
nikic Feb 12, 2025
80eef7b
[libc++] Remove obsolete guards for join_view being experimental (#12…
ldionne Feb 12, 2025
e575fee
[flang][FIR] handle argument attributes in fir.call (#126711)
jeanPerier Feb 12, 2025
320c79f
[libclc] Move conversion builtins to the CLC library (#124727)
frasercrmck Feb 12, 2025
83bab88
[clang][bytecode] Fix operator new source expression (#126870)
tbaederr Feb 12, 2025
a073687
[X86] combineEXTRACT_SUBVECTOR - fold extract_subvector(subv_broadcas…
RKSimon Feb 12, 2025
9f7d607
[MLIR][LLVMIR] Use TargetFolder when creating globals (#126745)
nikic Feb 12, 2025
87c9343
[llvm] Remove `br i1 undef` in some `llvm/test/CodeGen` tests (#126811)
Yeaseen Feb 12, 2025
7b12208
[mlir] Add missing dependency
nikic Feb 12, 2025
8e48631
[lldb] Support disassembling discontinuous functions (#126505)
labath Feb 12, 2025
29b74e8
[flang][OpenMP] Handle fixed length `charater`s in delayed privatizat…
ergawy Feb 12, 2025
baae21d
[X86] lowerShuffleAsBroadcast - use isShuffleEquivalent to search for…
RKSimon Feb 12, 2025
1bb3ab3
Revert "[NVPTX] Cleanup/Refactoring in NVPTX AsmPrinter and RegisterI…
metaflow Feb 12, 2025
0f21601
[bazel] port c03325cead2244ef0a89bb1cf365bddf16021daf
metaflow Feb 12, 2025
b3b8f0b
[analyzer] Add option assume-at-least-one-iteration (#125494)
NagyDonat Feb 12, 2025
daf67bc
[AArch64][DAG] Allow fptos/ui.sat to scalarized. (#126799)
davemgreen Feb 12, 2025
be69cae
[mlir] ArithToLLVM: fix memref bitcast lowering (#125148)
Hardcode84 Feb 12, 2025
667cb60
[NFC][LLVM][LangRef] Improve documentation for partial.reduce.add. (#…
paulwalker-arm Feb 12, 2025
0994ad7
Revert "[mlir] ArithToLLVM: fix memref bitcast lowering" (#126895)
Hardcode84 Feb 12, 2025
8d93683
[MLIR][mesh] Mesh fixes (#124724)
fschlimb Feb 12, 2025
b822746
[AArch64] Pre-commit tests for #125686 (NFC) (#126643)
jthackray Feb 12, 2025
ee39f9d
[NFC][LLVM][LangRef] Fix typos within partial.reduce.add documentation.
paulwalker-arm Feb 12, 2025
2adc9d4
[X86] canonicalizeShuffleWithOp - don't bother trying to move shuffle…
RKSimon Feb 12, 2025
79d53c6
[ValueTracking] Infer NonEqual from dominating conditions/assumptions…
dtcxzyw Feb 12, 2025
fbb6b8b
[libc++] Remove conditional for attributes that are always available …
philnik777 Feb 12, 2025
072927c
[X86] isShuffleFoldableLoad - only check that the SDValue has one use…
RKSimon Feb 12, 2025
a6efb2a
[libc++abi] Add a missing include for abort() (#126865)
atetubou Feb 12, 2025
ad82f39
Reland "CodeGen][NewPM] Port MachineScheduler to NPM. (#125703)" (#12…
optimisan Feb 12, 2025
e6d6f66
[mlir][bazel] Fix after https://github.com/llvm/llvm-project/commit/0…
chsigg Feb 12, 2025
c6cb410
[mlir][bazel] Fix after https://github.com/llvm/llvm-project/commit/0…
chsigg Feb 12, 2025
b24a854
[OpenMP][SIMD][FIX] Use conservative "omp simd ordered" lowering (#12…
MattPD Feb 12, 2025
7a8e769
[mlir] Mark variable as maybe_unused.
chsigg Feb 12, 2025
d73f9c9
[LoopVectorize] Make collectInLoopReductions more efficient (#126769)
david-arm Feb 12, 2025
a51016e
[Flang] Fix options for FunctionAttr pass (#126819)
rscottmanley Feb 12, 2025
7ed69fd
[HLSL] Change clang Driver Options to not set CXXOperatorNames (#126758)
farzonl Feb 12, 2025
f0b5e42
[SLP][NFC]Improve dump of the ScheduleData, NFC
alexey-bataev Feb 12, 2025
22f708d
[IRBuilder] Add additional overload with in-place Inserter constructi…
nikic Feb 12, 2025
488ce90
[NFC][Lanai][Hexagon] Define DEBUG_TYPE after including Debug.h. (#12…
nvjle Feb 12, 2025
e4345dd
Define -DLLVM_BUILD_TELEMETRY to be used in ifdef (#126746)
oontvoo Feb 12, 2025
a95a8fe
Revert "[SLP][NFC]Improve dump of the ScheduleData, NFC"
alexey-bataev Feb 12, 2025
5fdfad7
[gn] port fc4d87100a0
nico Feb 12, 2025
9bd4c7e
[SLP][NFC]Improve dump of the ScheduleData, NFC
alexey-bataev Feb 12, 2025
efd2bf0
[Flang] fix initializer with empty string to fix aarch64 build (#126918)
rscottmanley Feb 12, 2025
e32ef08
[clang][analysis] Fix flaky clang/test/Analysis/live-stmts.cpp test (…
steakhal Feb 12, 2025
5e46853
[Docs][LangRef] Fix broken ref to pointer capture. NFC (#126910)
dtcxzyw Feb 12, 2025
0d202bd
[NFC][analyzer] OOB test consolidation II: constraint checking (#126748)
NagyDonat Feb 12, 2025
5ffc2e6
[BOLT] Prevent addRelocation from adding pending relocs (#123635)
paschalis-mpeis Feb 12, 2025
b947982
[Flang][OpenMP] Update semantics checks for 'teams' nesting (#126922)
skatrak Feb 12, 2025
a098066
[X86] fp-fold.ll - regenerate checks
RKSimon Feb 12, 2025
beb99fd
[NVPTX] Convert scalar function nvvm.annotations to attributes (#125908)
AlexMaclean Feb 12, 2025
b5ed280
[X86] Avoid repeated hash lookups (NFC) (#126857)
kazutakahirata Feb 12, 2025
8c8123a
[bazel] port fc4d87100a01f08dbdf78b68e1a6a5c2584d840d
metaflow Feb 12, 2025
dfeef87
Reapply "[RISCV] Allow undef prefix for local repeating VLA shuffle l…
preames Feb 12, 2025
f285635
Revert "[Clang][CMake][MSVC] Install PDBs alongside executables" (#12…
mayanez Feb 12, 2025
fe8d601
[TableGen] Emit OpName as an enum class instead of a namespace (#125313)
jurahul Feb 12, 2025
6b02b0b
[lldb] Remove Debugger::Get{Output,Error}Stream (NFC) (#126821)
JDevlieghere Feb 12, 2025
147bd30
[flang] add ABI argument attributes in indirect calls (#126896)
jeanPerier Feb 12, 2025
e633db4
Revert "[RISCV] Decompose single source shuffles (without exact VLEN)…
preames Feb 12, 2025
3ba4250
[OpenMP][OpenMPIRBuilder] Support SPIR-V device variant matches (#126…
sarnex Feb 12, 2025
0cdced1
[Analysis] Avoid repeated hash lookups (NFC) (#126851)
kazutakahirata Feb 12, 2025
f4d3ed2
[CodeGen] Avoid repeated hash lookups (NFC) (#126852)
kazutakahirata Feb 12, 2025
7c9d95f
[Object] Avoid repeated map lookups (NFC) (#126853)
kazutakahirata Feb 12, 2025
3bf81f0
[SPIRV] Avoid repeated hash lookups (NFC) (#126854)
kazutakahirata Feb 12, 2025
e88d3a1
[Xtensa] Add XtensaDesc dependency to LLVMXtensaDisassembler (#126904)
e-kud Feb 12, 2025
c002af9
[Utils] Avoid repeated hash lookups (NFC) (#126856)
kazutakahirata Feb 12, 2025
535397e
[libc][bit_test] fix -Wimplicit-int-conversion (#126317)
nickdesaulniers Feb 12, 2025
3ae02a8
[X86] 2011-10-27-tstore.ll - regenerate checks
RKSimon Feb 12, 2025
e835edd
Reland [mlir] ArithToLLVM: fix memref bitcast lowering (#125148) (#12…
Hardcode84 Feb 12, 2025
0dc5629
[NFC] Avoid potential null dereference. (#126872)
schittir Feb 12, 2025
a9f9442
[DebugInfo] Update DIBuilder insertion to take InsertPosition (#126059)
hvdijk Feb 12, 2025
795902d
Revert "[DebugInfo] Update DIBuilder insertion to take InsertPosition…
hvdijk Feb 12, 2025
0bb20a2
workflows/release-binaries-all: Add missing secret input (#126921)
tstellar Feb 12, 2025
a78e911
[flang] [runtime] Explicitly disable EH & RTTI (#126920)
mgorny Feb 12, 2025
1624713
[libc] Fix implict cast to time_t warning (#126947)
michaelrj-google Feb 12, 2025
7610aac
Revert "[bazel] Temporarily disable a broken LookupAddressRangeWithSt…
labath Feb 12, 2025
f2ba3bb
[mlir] Match before rewrite in BubbleUpPackOpThroughGenericOp (#126946)
Max191 Feb 12, 2025
a7545ab
[X86] vec-strict-fptoint - regenerate VPTERNLOG comments
RKSimon Feb 12, 2025
c09e98b
[X86] vec-strict-cmp-512-skx.ll - regenerate checks
RKSimon Feb 12, 2025
03e71a3
[X86] vec-strict-cmp-128-fp16.ll - regenerate VMOVSH comments
RKSimon Feb 12, 2025
0b4a71d
[msan] Handle llvm.[us]cmp (starship operator) (#125804)
thurstond Feb 12, 2025
aa360a5
[DirectX] Set Shader Flag DisableOptimizations (#126813)
bharadwajy Feb 12, 2025
58a13f9
[lldb] Update ThreadPlanStepOut to handle new breakpoint behavior (#1…
jasonmolenda Feb 12, 2025
a5618a0
[lldb] inserted a typeo when checking in a suggested fix
jasonmolenda Feb 12, 2025
56167d6
[mlir] Python: Parse ModuleOp from file path (#126572)
nikalra Feb 12, 2025
adc7fc3
Add a pass to collect dropped var statistics for MIR (#126686)
rastogishubham Feb 12, 2025
5c95559
[libc][stdfix] Implement `countlsfx` functions in libc. (#126597)
krishna2803 Feb 12, 2025
f76827d
[HLSL][Docs] Update function calls docs (#106860)
llvm-beanz Feb 12, 2025
eacc139
[libc] Move __LLVM_LIBC__ define to __llvm-libc-common.h (#126877)
petrhosek Feb 12, 2025
9f04032
[SandboxVec][Scheduler] Fix top of schedule (#126820)
vporpo Feb 12, 2025
f35f69a
[clang] run clang-format on some CGObjC files (#126644)
DataCorrupted Feb 12, 2025
11974a4
[RISCV] Decompose single source shuffles (without exact VLEN) (#126951)
preames Feb 12, 2025
7481069
[SandboxVec][Legality] Fix mask on diamond reuse with shuffle (#126963)
vporpo Feb 12, 2025
51cad11
[AMDGPU] iglp.opt does not clobber memory operands (#126976)
jrbyrnes Feb 12, 2025
43120de
[mlir][acc] Clean up TypedValue builders (#126968)
razvanlupusoru Feb 12, 2025
745b475
[mlir] BytecodeWriter: invoke `reserveExtraSpace` (#126953)
nikalra Feb 12, 2025
ee72f6b
[hwasan][NFCI] Add more test cases to llvm/test/Instrumentation/HWAdd…
thurstond Feb 12, 2025
7010a40
[gn build] Port 92f916faba13
llvmgnsyncbot Feb 12, 2025
f7daffd
[RISCV] Default to MicroOpBufferSize = 1 for scheduling purposes (#12…
preames Feb 12, 2025
4a91ac3
[SandboxVec] Fix warnings introduced by 7a7f9190d03e
vporpo Feb 12, 2025
f8a4fe5
[LAA] Also clear CheckingGroups in RuntimePointerChecking::reset.
fhahn Feb 12, 2025
ec84684
[msan] Handle single-parameter Arm NEON vector convert intrinsics (#1…
thurstond Feb 12, 2025
5135feb
[libc][pthread] fix -Wmissing-field-initializers (#126314)
nickdesaulniers Feb 12, 2025
16044f7
[SanbdoxVec][BottomUpVec] Fix diamond shuffle with multiple vector in…
vporpo Feb 12, 2025
9bdaac9
[libc++] Add a link to __builtin_verbose_trap from the hardening docs…
ldionne Feb 12, 2025
0c6bfb6
[libc++] Simplify the apple-system-hardened CI configuration (#126911)
ldionne Feb 12, 2025
d64a9f9
[mlir][tosa]-Edit the verifier of tosa constShapeOp (#126962)
amirBish Feb 12, 2025
0da960f
[SandboxVec][DAG] Fix DAG when old interval is mem free (#126983)
vporpo Feb 12, 2025
0a4fb00
[mlir][tensor] Make useful Tensor utilities public (#126802)
banach-space Feb 12, 2025
5e636bc
[AMDGPU] SelDAG: fix lowering of undefined workitem intrinsics (#126058)
ro-i Feb 12, 2025
c58637a
[lldb-dap] add `debugAdapterExecutable` property to launch configurat…
matthewbastien Feb 12, 2025
0850676
[compiler-rt] [sanitizer] avoid UB in allocator (#126977)
fmayer Feb 12, 2025
369219a
[MLIR][Affine] Fix fusion crash for non-int/fp memref elt types (#126…
bondhugula Feb 12, 2025
27d9867
[lldb-dap] Fix: Could not find DAP in path (#126903)
da-viper Feb 13, 2025
10a80d8
[lldb-dap] Bump the version number for publishing in the Marketplace
JDevlieghere Feb 13, 2025
637ed4e
[msan] Handle Arm NEON saturating extract and narrow (#125742)
thurstond Feb 13, 2025
689998b
[Support] Prefer AUX vector for page size (#126863)
RossComputerGuy Feb 13, 2025
294b1e6
[MLIR][Affine] Fix sibling fusion - missing check (#126626)
bondhugula Feb 13, 2025
16ef2aa
[mlir][vector] Fix out-of-bounds access (#126734)
CoTinker Feb 13, 2025
d5e28e6
[NFC] [sanitizer] allow getauxval in symbolizer
fmayer Feb 13, 2025
989bb22
[hwasan][NFCI] Rename ClRandomSkipRate to ClRandomKeepRate (#126990)
thurstond Feb 13, 2025
7cb4380
[lldb-dap] Upgrade @types/node to fix TS2386 in node/module.d.ts (#12…
JDevlieghere Feb 13, 2025
77309b6
[SPARC][IAS] Add IAS flag handling for ISA levels
koachan Feb 13, 2025
b4777b8
[Support] Fix building on FreeBSD and OpenBSD (#127005)
brad0 Feb 13, 2025
4c7a2a8
Orc: Suppress a warning in #126691
chapuni Feb 13, 2025
fbac315
[bazel] Introduce HAVE_SYS_AUXV_H for #126863
chapuni Feb 13, 2025
873ee09
[ORC] Silence unused variable warnings.
lhames Feb 13, 2025
db43ed3
[flang][acc] Implement type categorization for FIR types (#126964)
razvanlupusoru Feb 13, 2025
23f7261
[LTO][Pipelines][Coro] Handle coroutines in LTO pipeline (#126168)
vitalybuka Feb 13, 2025
2e49d4f
[libclang] Always Dup in createRef(StringRef) (#125020)
vitalybuka Feb 13, 2025
e0ad3d9
[clang] [ASTDump] Add support for structural value template arguments…
sakria9 Feb 13, 2025
b9c250f
[InstCombine] Fold mul (shr exact (X, N)), 2^N + 1 -> add (X , shr ex…
AZero13 Feb 13, 2025
e9a3d26
[llvm][bazel] Adjust to HAVE_SYS_AUXV_H > HAVE_GETAUXVAL in https://g…
chsigg Feb 13, 2025
ff6a4cb
[RISCV][NFC] Move GenericModel to standalone file (#127003)
wangpc-pp Feb 13, 2025
88a4d24
[mlir][affine]make affine-loop-unroll a FunctionOpInterface pass. (#1…
linuxlonelyeagle Feb 13, 2025
9e4472e
[MLIR][LLVMIR] Always use TargetFolder in IRBuilder (#126929)
nikic Feb 13, 2025
57e9540
[libcxx] Add a missing include for __bit_iterator (#127015)
atetubou Feb 13, 2025
7a356c9
[libcxx] Add a missing include for __enable_if_t (#127016)
atetubou Feb 13, 2025
3a58168
[lldb/DWARF] Resolve type unit references in llvm DWARFDIE compatibil…
labath Feb 13, 2025
a0d7415
[flang] Update f128 tests
nikic Feb 13, 2025
fe864ab
[CaptureTracking][FunctionAttrs] Add support for CaptureInfo (#125880)
nikic Feb 13, 2025
2993012
[MISched][NFC] Remove unused heuristic NextDefUse from enum (#125879)
c-rhodes Feb 13, 2025
659d771
[SDAG] Harden assumption in getMemsetStringVal (#126207)
c-rhodes Feb 13, 2025
3d47d9a
[mlir][bufferization] Remove `buffer-deallocation` pass (#126366)
matthias-springer Feb 13, 2025
60f0e05
[mlir][bazel] Port a472147af4ad
chsigg Feb 13, 2025
cb5992e
[lldb] Fix Block::GetRangeIndexContainingAddress for discontinuous fu…
labath Feb 13, 2025
96458ef
[ARM] Fix calling convention for __fp16 with big-endian (#126741)
ostannard Feb 13, 2025
54a65dc
[IR] Mark mul constant expression as undesirable
nikic Feb 11, 2025
da2ac55
[LLVM][AArch64] Remove aliases of LSUI instructions (#126072)
kmclaughlin-arm Feb 13, 2025
8737638
[mlir][NFC] Add missing `)` in doc for `--mlir-print-local-scope` (#1…
vguerra Feb 13, 2025
e8c3575
[MLIR][LLVMIR] Fix use-after-move
nikic Feb 13, 2025
cf02e67
TableGen: Add missing consts to CodeGenSubRegIndex
arsenm Feb 13, 2025
e43dbb5
[lldb][SBAPI] Add new SBType::GetTemplateParameterValue API (#126901)
Michael137 Feb 13, 2025
e823f14
[analyzer] Disable a flaky test while triaging why its flaky (#127034)
steakhal Feb 13, 2025
3ef0e7f
[clang] Fix preprocessor output from #embed (#126742)
Fznamznon Feb 13, 2025
cd6f46d
AMDGPU: Add more tests for peephole opt subregister composing
arsenm Feb 4, 2025
909fd42
[lldb] Correctly resolve (discontinuous) function offsets when disass…
labath Feb 13, 2025
618e74f
[LoopVectorizer][AArch64] Add support for partial reduce subtraction …
NickGuy-Arm Feb 13, 2025
6878783
[reland][DebugInfo] Update DIBuilder insertion to take InsertPosition…
hvdijk Feb 13, 2025
95c06d4
[AMDGPU] Add a regression test for -mattr=dumpcode (#116982)
jayfoad Feb 13, 2025
6912175
AMDGPU: Add baseline test for treating v_pk_mov_b32 like reg_sequence…
arsenm Feb 13, 2025
8b10a39
[IR][ModRef] Introduce `errno` memory location
antoniofrighetto Feb 10, 2025
8c88cb5
[clang] CTAD: Remove an incorrect assertion in BuildDeductionGuideFor…
hokein Feb 13, 2025
08e541a
[flang][debug] Allow variable from non-entry blocks. (#125692)
abidh Feb 13, 2025
50f2560
AMDGPU: Mark sendmsg intrinsics as nocallback (#126782)
arsenm Feb 13, 2025
3ae58c1
LAA: fix logic for MaxTargetVectorWidth (#125487)
artagnon Feb 13, 2025
e865105
[X86] Fix shadow variable warning. NFC.
RKSimon Feb 13, 2025
021ebc6
add new lines to testcase
flovent Feb 13, 2025
551b041
implement with set and skip -1 file descriptor too
flovent Feb 13, 2025
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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @dcci @yota9

# Bazel build system.
/utils/bazel/ @rupprecht @keith
/utils/bazel/ @rupprecht @keith @aaronmondal

# InstallAPI and TextAPI
/llvm/**/TextAPI/ @cyndyishida
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-binaries-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ on:
required: true
default: false
type: boolean
secrets:
RELEASE_TASKS_USER_TOKEN:
description: "Secret used to check user permissions."
required: false

pull_request:
types:
Expand Down
10 changes: 2 additions & 8 deletions bolt/include/bolt/Core/BinarySection.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,9 @@ class BinarySection {

/// Add a new relocation at the given /p Offset.
void addRelocation(uint64_t Offset, MCSymbol *Symbol, uint64_t Type,
uint64_t Addend, uint64_t Value = 0,
bool Pending = false) {
uint64_t Addend, uint64_t Value = 0) {
assert(Offset < getSize() && "offset not within section bounds");
if (!Pending) {
Relocations.emplace(Relocation{Offset, Symbol, Type, Addend, Value});
} else {
PendingRelocations.emplace_back(
Relocation{Offset, Symbol, Type, Addend, Value});
}
Relocations.emplace(Relocation{Offset, Symbol, Type, Addend, Value});
}

/// Add a dynamic relocation at the given /p Offset.
Expand Down
12 changes: 1 addition & 11 deletions bolt/tools/driver/llvm-bolt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,24 +173,14 @@ void boltMode(int argc, char **argv) {
}
}

static std::string GetExecutablePath(const char *Argv0) {
SmallString<256> ExecutablePath(Argv0);
// Do a PATH lookup if Argv0 isn't a valid path.
if (!llvm::sys::fs::exists(ExecutablePath))
if (llvm::ErrorOr<std::string> P =
llvm::sys::findProgramByName(ExecutablePath))
ExecutablePath = *P;
return std::string(ExecutablePath);
}

int main(int argc, char **argv) {
// Print a stack trace if we signal out.
sys::PrintStackTraceOnErrorSignal(argv[0]);
PrettyStackTraceProgram X(argc, argv);

llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.

std::string ToolPath = GetExecutablePath(argv[0]);
std::string ToolPath = llvm::sys::fs::getMainExecutable(argv[0], nullptr);

// Initialize targets and assembly printers/parsers.
llvm::InitializeAllTargetInfos();
Expand Down
14 changes: 8 additions & 6 deletions bolt/unittests/Core/BinaryContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ TEST_P(BinaryContextTester, FlushPendingRelocCALL26) {
DataSize, 4);
MCSymbol *RelSymbol1 = BC->getOrCreateGlobalSymbol(4, "Func1");
ASSERT_TRUE(RelSymbol1);
BS.addRelocation(8, RelSymbol1, ELF::R_AARCH64_CALL26, 0, 0, true);
BS.addPendingRelocation(
Relocation{8, RelSymbol1, ELF::R_AARCH64_CALL26, 0, 0});
MCSymbol *RelSymbol2 = BC->getOrCreateGlobalSymbol(16, "Func2");
ASSERT_TRUE(RelSymbol2);
BS.addRelocation(12, RelSymbol2, ELF::R_AARCH64_CALL26, 0, 0, true);
BS.addPendingRelocation(
Relocation{12, RelSymbol2, ELF::R_AARCH64_CALL26, 0, 0});

std::error_code EC;
SmallVector<char> Vect(DataSize);
raw_svector_ostream OS(Vect);

Expand Down Expand Up @@ -134,12 +135,13 @@ TEST_P(BinaryContextTester, FlushPendingRelocJUMP26) {
(uint8_t *)Data, Size, 4);
MCSymbol *RelSymbol1 = BC->getOrCreateGlobalSymbol(4, "Func1");
ASSERT_TRUE(RelSymbol1);
BS.addRelocation(8, RelSymbol1, ELF::R_AARCH64_JUMP26, 0, 0, true);
BS.addPendingRelocation(
Relocation{8, RelSymbol1, ELF::R_AARCH64_JUMP26, 0, 0});
MCSymbol *RelSymbol2 = BC->getOrCreateGlobalSymbol(16, "Func2");
ASSERT_TRUE(RelSymbol2);
BS.addRelocation(12, RelSymbol2, ELF::R_AARCH64_JUMP26, 0, 0, true);
BS.addPendingRelocation(
Relocation{12, RelSymbol2, ELF::R_AARCH64_JUMP26, 0, 0});

std::error_code EC;
SmallVector<char> Vect(Size);
raw_svector_ostream OS(Vect);

Expand Down
95 changes: 60 additions & 35 deletions clang/docs/HLSL/FunctionCalls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,14 @@ which is a term made up for HLSL. A cx-value is a temporary value which may be
the result of a cast, and stores its value back to an lvalue when the value
expires.

To represent this concept in Clang we introduce a new ``HLSLOutParamExpr``. An
``HLSLOutParamExpr`` has two forms, one with a single sub-expression and one
with two sub-expressions.
To represent this concept in Clang we introduce a new ``HLSLOutArgExpr``. An
``HLSLOutArgExpr`` has three sub-expressions:

The single sub-expression form is used when the argument expression and the
function parameter are the same type, so no cast is required. As in this
example:
* An OpaqueValueExpr of the argument lvalue expression.
* An OpaqueValueExpr of the copy-initialized parameter temporary.
* A BinaryOpExpr assigning the first with the value of the second.

Given this example:

.. code-block:: c++

Expand All @@ -267,23 +268,36 @@ example:
Init(V);
}

The expected AST formulation for this code would be something like:
The expected AST formulation for this code would be something like the example
below. Due to the nature of OpaqueValueExpr nodes, the nodes repeat in the AST
dump. The fake addresses ``0xSOURCE`` and ``0xTEMPORARY`` denote the source
lvalue and argument temporary lvalue expressions.

.. code-block:: text

CallExpr 'void'
|-ImplicitCastExpr 'void (*)(int &)' <FunctionToPointerDecay>
| `-DeclRefExpr 'void (int &)' lvalue Function 'Init' 'void (int &)'
|-HLSLOutParamExpr 'int' lvalue inout
`-DeclRefExpr 'int' lvalue Var 'V' 'int'

The ``HLSLOutParamExpr`` captures that the value is ``inout`` vs ``out`` to
denote whether or not the temporary is initialized from the sub-expression. If
no casting is required the sub-expression denotes the lvalue expression that the
cx-value will be copied to when the value expires.

The two sub-expression form of the AST node is required when the argument type
is not the same as the parameter type. Given this example:
`-HLSLOutArgExpr <col:10> 'int' lvalue inout
|-OpaqueValueExpr 0xSOURCE <col:10> 'int' lvalue
| `-DeclRefExpr <col:10> 'int' lvalue Var 'V' 'int'
|-OpaqueValueExpr 0xTEMPORARY <col:10> 'int' lvalue
| `-ImplicitCastExpr <col:10> 'int' <LValueToRValue>
| `-OpaqueValueExpr 0xSOURCE <col:10> 'int' lvalue
| `-DeclRefExpr <col:10> 'int' lvalue Var 'V' 'int'
`-BinaryOperator <col:10> 'int' lvalue '='
|-OpaqueValueExpr 0xSOURCE <col:10> 'int' lvalue
| `-DeclRefExpr <col:10> 'int' lvalue Var 'V' 'int'
`-ImplicitCastExpr <col:10> 'int' <LValueToRValue>
`-OpaqueValueExpr 0xTEMPORARY <col:10> 'int' lvalue
`-ImplicitCastExpr <col:10> 'int' <LValueToRValue>
`-OpaqueValueExpr 0xSOURCE <col:10> 'int' lvalue
`-DeclRefExpr <col:10> 'int' lvalue Var 'V' 'int'

The ``HLSLOutArgExpr`` captures that the value is ``inout`` vs ``out`` to
denote whether or not the temporary is initialized from the sub-expression.

The example below demonstrates argument casting:

.. code-block:: c++

Expand All @@ -295,28 +309,39 @@ is not the same as the parameter type. Given this example:
Trunc(F);
}

For this case the ``HLSLOutParamExpr`` will have sub-expressions to record both
For this case the ``HLSLOutArgExpr`` will have sub-expressions to record both
casting expression sequences for the initialization and write back:

.. code-block:: text

-CallExpr 'void'
|-ImplicitCastExpr 'void (*)(int3 &)' <FunctionToPointerDecay>
| `-DeclRefExpr 'void (int3 &)' lvalue Function 'inc_i32' 'void (int3 &)'
`-HLSLOutParamExpr 'int3' lvalue inout
|-ImplicitCastExpr 'float3' <IntegralToFloating>
| `-ImplicitCastExpr 'int3' <LValueToRValue>
| `-OpaqueValueExpr 'int3' lvalue
`-ImplicitCastExpr 'int3' <FloatingToIntegral>
`-ImplicitCastExpr 'float3' <LValueToRValue>
`-DeclRefExpr 'float3' lvalue 'F' 'float3'

In this formation the write-back casts are captured as the first sub-expression
and they cast from an ``OpaqueValueExpr``. In IR generation we can use the
``OpaqueValueExpr`` as a placeholder for the ``HLSLOutParamExpr``'s temporary
value on function return.

In code generation this can be implemented with some targeted extensions to the
Objective-C write-back support. Specifically extending CGCall.cpp's
``EmitWriteback`` function to support casting expressions and emission of
aggregate lvalues.
`-HLSLOutArgExpr <col:11> 'int3':'vector<int, 3>' lvalue inout
|-OpaqueValueExpr 0xSOURCE <col:11> 'float3':'vector<float, 3>' lvalue
| `-DeclRefExpr <col:11> 'float3':'vector<float, 3>' lvalue Var 'F' 'float3':'vector<float, 3>'
|-OpaqueValueExpr 0xTEMPORARY <col:11> 'int3':'vector<int, 3>' lvalue
| `-ImplicitCastExpr <col:11> 'vector<int, 3>' <FloatingToIntegral>
| `-ImplicitCastExpr <col:11> 'float3':'vector<float, 3>' <LValueToRValue>
| `-OpaqueValueExpr 0xSOURCE <col:11> 'float3':'vector<float, 3>' lvalue
| `-DeclRefExpr <col:11> 'float3':'vector<float, 3>' lvalue Var 'F' 'float3':'vector<float, 3>'
`-BinaryOperator <col:11> 'float3':'vector<float, 3>' lvalue '='
|-OpaqueValueExpr 0xSOURCE <col:11> 'float3':'vector<float, 3>' lvalue
| `-DeclRefExpr <col:11> 'float3':'vector<float, 3>' lvalue Var 'F' 'float3':'vector<float, 3>'
`-ImplicitCastExpr <col:11> 'vector<float, 3>' <IntegralToFloating>
`-ImplicitCastExpr <col:11> 'int3':'vector<int, 3>' <LValueToRValue>
`-OpaqueValueExpr 0xTEMPORARY <col:11> 'int3':'vector<int, 3>' lvalue
`-ImplicitCastExpr <col:11> 'vector<int, 3>' <FloatingToIntegral>
`-ImplicitCastExpr <col:11> 'float3':'vector<float, 3>' <LValueToRValue>
`-OpaqueValueExpr 0xSOURCE <col:11> 'float3':'vector<float, 3>' lvalue
`-DeclRefExpr <col:11> 'float3':'vector<float, 3>' lvalue Var 'F' 'float3':'vector<float, 3>'

The AST representation is the same whether casting is required or not, which
simplifies the code generation. IR generation does the following:

* Emit the argument lvalue expression.
* Initialize the argument:
* For ``inout`` arguments, emit the copy-initialization expression.
* For ``out`` arguments, emit an uninitialized temporary.
* Emit the call
* Emit the write-back BinaryOperator expression.
12 changes: 12 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ ABI Changes in This Version
AST Dumping Potentially Breaking Changes
----------------------------------------

- Added support for dumping template arguments of structural value kinds.

Clang Frontend Potentially Breaking Changes
-------------------------------------------

Expand Down Expand Up @@ -104,6 +106,10 @@ Non-comprehensive list of changes in this release
New Compiler Flags
------------------

- New option ``-fprofile-continuous`` added to enable continuous profile syncing to file (#GH124353, `docs <https://clang.llvm.org/docs/UsersManual.html#cmdoption-fprofile-continuous>`_).
The feature has `existed <https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#running-the-instrumented-program>`_)
for a while and this is just a user facing option.

Deprecated Compiler Flags
-------------------------

Expand Down Expand Up @@ -141,6 +147,9 @@ Improvements to Coverage Mapping
Bug Fixes in This Version
-------------------------

- Clang now outputs correct values when #embed data contains bytes with negative
signed char values (#GH102798).

Bug Fixes to Compiler Builtins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -248,6 +257,9 @@ clang-format
libclang
--------

- Fixed a buffer overflow in ``CXString`` implementation. The fix may result in
increased memory allocation.

Code Completion
---------------

Expand Down
2 changes: 1 addition & 1 deletion clang/docs/TypeSanitizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ reduce these impacts.
The TypeSanitizer Algorithm
===========================
For each TBAA type-access descriptor, encoded in LLVM IR using TBAA Metadata, the instrumentation
pass generates descriptor tales. Thus there is a unique pointer to each type (and access descriptor).
pass generates descriptor tables. Thus there is a unique pointer to each type (and access descriptor).
These tables are comdat (except for anonymous-namespace types), so the pointer values are unique
across the program.

Expand Down
96 changes: 93 additions & 3 deletions clang/docs/analyzer/developer-docs/PerformanceInvestigation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Performance Investigation
Multiple factors contribute to the time it takes to analyze a file with Clang Static Analyzer.
A translation unit contains multiple entry points, each of which take multiple steps to analyze.

Performance analysis using ``-ftime-trace``
===========================================

You can add the ``-ftime-trace=file.json`` option to break down the analysis time into individual entry points and steps within each entry point.
You can explore the generated JSON file in a Chromium browser using the ``chrome://tracing`` URL,
or using `speedscope <https://speedscope.app>`_.
Expand All @@ -19,9 +22,8 @@ Here is an example of a time trace produced with
.. code-block:: bash
:caption: Clang Static Analyzer invocation to generate a time trace of string.c analysis.

clang -cc1 -nostdsysteminc -analyze -analyzer-constraints=range \
-setup-static-analyzer -analyzer-checker=core,unix,alpha.unix.cstring,debug.ExprInspection \
-verify ./clang/test/Analysis/string.c \
clang -cc1 -analyze -verify clang/test/Analysis/string.c \
-analyzer-checker=core,unix,alpha.unix.cstring,debug.ExprInspection \
-ftime-trace=trace.json -ftime-trace-granularity=1

.. image:: ../images/speedscope.png
Expand All @@ -45,3 +47,91 @@ Note: Both Chrome-tracing and speedscope tools might struggle with time traces a
Luckily, in most cases the default max-steps boundary of 225 000 produces the traces of approximately that size
for a single entry point.
You can use ``-analyze-function=get_global_options`` together with ``-ftime-trace`` to narrow down analysis to a specific entry point.


Performance analysis using ``perf``
===================================

`Perf <https://perfwiki.github.io/main/>`_ is a tool for conducting sampling-based profiling.
It's easy to start profiling, you only have 2 prerequisites.
Build with ``-fno-omit-frame-pointer`` and debug info (``-g``).
You can use release builds, but probably the easiest is to set the ``CMAKE_BUILD_TYPE=RelWithDebInfo``
along with ``CMAKE_CXX_FLAGS="-fno-omit-frame-pointer"`` when configuring ``llvm``.
Here is how to `get started <https://llvm.org/docs/CMake.html#quick-start>`_ if you are in trouble.

.. code-block:: bash
:caption: Running the Clang Static Analyzer through ``perf`` to gather samples of the execution.

# -F: Sampling frequency, use `-F max` for maximal frequency
# -g: Enable call-graph recording for both kernel and user space
perf record -F 99 -g -- clang -cc1 -analyze -verify clang/test/Analysis/string.c \
-analyzer-checker=core,unix,alpha.unix.cstring,debug.ExprInspection

Once you have the profile data, you can use it to produce a Flame graph.
A Flame graph is a visual representation of the stack frames of the samples.
Common stack frame prefixes are squashed together, making up a wider bar.
The wider the bar, the more time was spent under that particular stack frame,
giving a sense of how the overall execution time was spent.

Clone the `FlameGraph <https://github.com/brendangregg/FlameGraph>`_ git repository,
as we will use some scripts from there to convert the ``perf`` samples into a Flame graph.
It's also useful to check out Brendan Gregg's (the author of FlameGraph)
`homepage <https://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html>`_.


.. code-block:: bash
:caption: Converting the ``perf`` profile into a Flamegraph, then opening it in Firefox.

perf script | /path/to/FlameGraph/stackcollapse-perf.pl > perf.folded
/path/to/FlameGraph/flamegraph.pl perf.folded > perf.svg
firefox perf.svg

.. image:: ../images/flamegraph.png


Performance analysis using ``uftrace``
======================================

`uftrace <https://github.com/namhyung/uftrace/wiki/Tutorial#getting-started>`_ is a great tool to generate rich profile data
that you can use to focus and drill down into the timeline of your application.
We will use it to generate Chromium trace JSON.
In contrast to ``perf``, this approach statically instruments every function, so it should be more precise and thorough than the sampling-based approaches like ``perf``.
In contrast to using ``-ftime-trace``, functions don't need to opt-in to be profiled using ``llvm::TimeTraceScope``.
All functions are profiled due to automatic static instrumentation.

There is only one prerequisite to use this tool.
You need to build the binary you are about to instrument using ``-pg`` or ``-finstrument-functions``.
This will make it run substantially slower but allows rich instrumentation.
It will also consume many gigabites of storage for a single trace unless filter flags are used during recording.

.. code-block:: bash
:caption: Recording with ``uftrace``, then dumping the result as a Chrome trace JSON.

uftrace record clang -cc1 -analyze -verify clang/test/Analysis/string.c \
-analyzer-checker=core,unix,alpha.unix.cstring,debug.ExprInspection
uftrace dump --filter=".*::AnalysisConsumer::HandleTranslationUnit" --time-filter=300 --chrome > trace.json

.. image:: ../images/uftrace_detailed.png

In this picture, you can see the functions below the Static Analyzer's entry point, which takes at least 300 nanoseconds to run, visualized by Chrome's ``about:tracing`` page
You can also see how deep function calls we may have due to AST visitors.

Using different filters can reduce the number of functions to record.
For the common options, refer to the ``uftrace`` `documentation <https://github.com/namhyung/uftrace/blob/master/doc/uftrace-record.md#common-options>`_.

Similar filters can be applied for dumping too. That way you can reuse the same (detailed)
recording to selectively focus on some special part using a refinement of the filter flags.
Remember, the trace JSON needs to fit into Chrome's ``about:tracing`` or `speedscope <https://speedscope.app>`_,
thus it needs to be of a limited size.
If you do not apply filters on recording, you will collect a large trace and every dump operation
would need to sieve through the much larger recording which may be annoying if done repeatedly.

If the trace JSON is still too large to load, have a look at the dump as plain text and look for frequent entries that refer to non-interesting parts.
Once you have some of those, add them as ``--hide`` flags to the ``uftrace dump`` call.
To see what functions appear frequently in the trace, use this command:

.. code-block:: bash

cat trace.json | grep -Po '"name":"(.+)"' | sort | uniq -c | sort -nr | head -n 50

``uftrace`` can also dump the report as a Flame graph using ``uftrace dump --framegraph``.
Binary file added clang/docs/analyzer/images/flamegraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added clang/docs/analyzer/images/uftrace_detailed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading