LLVM/project 61b0646llvm/lib/Transforms/IPO LowerTypeTests.cpp

[LowerTypeTests] Apply kill switch to CFI jump table reordering (#224782)

This is follow up to #221046, for which I failed to upload rebased
version.

* https://github.com/llvm/llvm-project/pull/221046
DeltaFile
+2-1llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+2-11 files

LLVM/project 8538563llvm/lib/Transforms/IPO LowerTypeTests.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+2-1llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+2-11 files

LLVM/project 2adfaf8llvm/include/llvm/SandboxIR Type.h, llvm/unittests/SandboxIR TypesTest.cpp

[SandboxIR] Implement PointerType::getAddressSpace() (#224751)

This patch implements PointerType::getAddressSpace() in Sandbox IR,
mirroring LLVM IR.
DeltaFile
+5-0llvm/include/llvm/SandboxIR/Type.h
+3-0llvm/unittests/SandboxIR/TypesTest.cpp
+8-02 files

LLVM/project 3228e8fllvm/lib/Transforms/IPO LowerTypeTests.cpp, llvm/test/Transforms/LowerTypeTests cfi-jumptable-hotness-summary.ll

[LowerTypeTests] Reorder CFI jump table entries based on hotness (#221046)

Order CFI jump table entries by function hotness. We use `cfi.functions`
metadata in ThinLTO, or `BlockFrequencyInfo` / function entry counts in
full LTO.

We want the hottest function to be optimized by the last entry thing for
SHT_LLVM_CFI_JUMP_TABLE. The linker deletes the final branch in the jump
table and moves the table directly before that target function so it
falls through.

This also ensures the jump table lands in a hot section (.text.hot)
instead of a cold section (.text.unlikely). Type contiguity is
preserved.

This PR reliably improves the performance of our server binary by 0.2%,
and some smaller binaries up to 5%.

PR Stack:

    [8 lines not shown]
DeltaFile
+48-5llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+7-7llvm/test/Transforms/LowerTypeTests/cfi-jumptable-hotness-summary.ll
+55-122 files

LLVM/project 349afefclang/lib/CIR/Dialect/Analysis CIRBasicAliasAnalysis.cpp, clang/test/CIR/Analysis alias-analysis-underlying-object.cir

rebase

Created using spr 1.3.7
DeltaFile
+234-147llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+271-78clang/test/CIR/Analysis/alias-analysis-underlying-object.cir
+211-120clang/lib/CIR/Dialect/Analysis/CIRBasicAliasAnalysis.cpp
+0-276llvm/lib/Target/SPIRV/SPIRVLegalizeImplicitBinding.cpp
+276-0llvm/lib/Target/SPIRV/SPIRVLegalizeResourceBinding.cpp
+196-32mlir/lib/Conversion/VectorToXeGPU/VectorToXeGPU.cpp
+1,188-65357 files not shown
+3,039-89563 files

LLVM/project d34ec23clang/test/CodeGenCXX GH211943.cpp builtin-dump-struct.cpp

[Clang][NFC] Move GH211943 test into existing builtin-dump-struct test file (#224421)

Follow-up to #212377 per post-commit review by @shafik.
Moves the regression test from a standalone GH211943.cpp into the
existing CodeGenCXX/builtin-dump-struct.cpp under a namespace GH211943
block, guarded by #ifdef TEST_WERROR with a second RUN line.
DeltaFile
+17-0clang/test/CodeGenCXX/builtin-dump-struct.cpp
+0-13clang/test/CodeGenCXX/GH211943.cpp
+17-132 files

LLVM/project 5e88b5allvm/test/Transforms/LowerTypeTests cfi-jumptable-hotness-summary.ll

[NFC][LowerTypeTests] Add RUN line for -reorder-cfi-jump-tables-profiles=false (#224779)

Update CHECK lines to match the new jump table layout in

* https://github.com/llvm/llvm-project/pull/224779

Assisted-by: Gemini
DeltaFile
+88-0llvm/test/Transforms/LowerTypeTests/cfi-jumptable-hotness-summary.ll
+88-01 files

LLVM/project 2537bfallvm/test/Transforms/LowerTypeTests cfi-jumptable-hotness-summary.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+88-0llvm/test/Transforms/LowerTypeTests/cfi-jumptable-hotness-summary.ll
+88-01 files

LLVM/project c100470llvm/test/Transforms/LowerTypeTests cfi-jumptable-hotness-summary.ll

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+88-0llvm/test/Transforms/LowerTypeTests/cfi-jumptable-hotness-summary.ll
+88-01 files

LLVM/project f8f4816llvm/lib/CodeGen TargetLoweringObjectFileImpl.cpp, llvm/test/MC/COFF ir-to-imgrel.ll ir-to-imgrel-reject.ll

[TargetLowering][COFF] Allow GlobalAlias in lowerRelativeReference (#220674)

In commit 2b321e2f293a (#203171), splitAndWriteThinLTOBitcode was
updated to create a GlobalAlias with external linkage for promoted
internal globals instead of renaming them directly.

When generating COFF object files on Windows (such as MSVC RTTI
CompleteObjectLocator structures), relative references against
@__ImageBase (e.g. sub (ptrtoint @alias to i64), (ptrtoint @__ImageBase
to i64))
are lowered to IMAGE_REL_AMD64_ADDR32NB (VK_COFF_IMGREL32) relocations
in TargetLoweringObjectFileCOFF::lowerRelativeReference.

Previously, lowerRelativeReference checked `!isa<GlobalObject>(LHS)`,
which rejected GlobalAlias instances. As a result,
lowerRelativeReference returned nullptr, and AsmPrinter fell back to
emitting a raw MC subtraction expression. This caused
WinCOFFObjectWriter
to fail with:

    [9 lines not shown]
DeltaFile
+45-0llvm/test/MC/COFF/ir-to-imgrel-reject.ll
+33-4llvm/test/MC/COFF/ir-to-imgrel.ll
+11-6llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+89-103 files

LLVM/project 38fbfd2llvm/include/llvm/SandboxIR Pass.h, llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes SeedCollection.h

[SanbdoxIR][SandboxVec] AuxPassArgs for auxiliary pass arguments (#224450)

This patch implements helper classes for handling the pass auxiliary
arguments. These classes handle the parsing of the auxiliary argument
string such that the passes themselves won't have to deal with it.

We currently only support boolean arguments that are false by default.
If an argument shows up in the string then it is set to true.

Example:
```
AuxPassArgsRegistry ArgsRegistry; // The "parent" of the arguments
AuxPassArg Arg1 = ArgsRegistry.createArg("arg1");
AuxPassArg Arg2 = ArgsRegistry.createArg("arg2");
...
ArgsRegistry.parse("arg1"); // From this point on (bool)Arg1 evaluates to true.

```


    [5 lines not shown]
DeltaFile
+73-0llvm/lib/SandboxIR/Pass.cpp
+54-0llvm/include/llvm/SandboxIR/Pass.h
+38-0llvm/unittests/SandboxIR/PassTest.cpp
+4-11llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/SeedCollection.cpp
+4-3llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/SeedCollection.h
+2-2llvm/test/Transforms/SandboxVectorizer/EndToEnd/seed_bundle_cross_erasure.ll
+175-163 files not shown
+178-199 files

LLVM/project 33b43ebllvm/docs TransformMetadata.md Security.md, llvm/docs/TableGen ProgRef.md

[LLVM][docs] Fix MyST migration review findings
DeltaFile
+29-29llvm/docs/SecurityTransparencyReports.md
+14-12llvm/docs/TableGen/ProgRef.md
+3-3llvm/docs/XRay.md
+3-3llvm/docs/StackMaps.md
+1-1llvm/docs/TransformMetadata.md
+1-1llvm/docs/Security.md
+51-496 files

LLVM/project ddce820llvm/tools/llvm-jitlink ConnectionUtils.h llvm-jitlink.cpp, llvm/tools/llvm-jitlink/llvm-jitlink-executor llvm-jitlink-executor.cpp

[llvm-jitlink] Rework out-of-process launch/connect options (#224632)

Replace -oop-executor and -oop-executor-connect, which were mutually
exclusive and each parsed their own ad hoc connection syntax, with two
orthogonal options built on the shared ConnectionSpec parser:

  -oop-launch [<path>]  Launch an out-of-process executor (default:
                        llvm-jitlink-executor).

  -oop-connect <spec>   How to connect to the executor, whether or not
                        it was launched by llvm-jitlink.

Either may be used alone (matching the old -oop-executor and
-oop-executor-connect behavior) or combined, e.g. to have llvm-jitlink
bind and listen while the executor it launches dials back in:

  llvm-jitlink -oop-launch -oop-connect=tcp:listen=127.0.0.1:0 a.o

Both llvm-jitlink and llvm-jitlink-executor now parse connection

    [15 lines not shown]
DeltaFile
+234-147llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+115-102llvm/tools/llvm-jitlink/llvm-jitlink-executor/llvm-jitlink-executor.cpp
+198-0llvm/tools/llvm-jitlink/ConnectionUtils.h
+547-2493 files

LLVM/project 03b58eallvm/lib/Target/AArch64 AArch64ISelLowering.cpp, llvm/test/CodeGen/AArch64 tail-call-stack-args.ll sme-za-tailcall-fpdiff-align.ll

[llvm][AArch64] Fix FPDiff founding direction in non-sibcall tail calls (#223545)

This fixes another subtle bug in frame accounting (see: #217156 /
#220406), for tail calls that have a non-multiple of 16 bytes worth of
stack arg area, and need that stack arg re-use to be increased to cover
the alignment requirement. This is best illustrated with callers
containing 8 formal arguments covering the first 8 GPRs (x0-x7),
followed by 9 bytes of argument passed on the stack.

In a callee-pops tail call (e.g. tailcc/swifttailcc), the set of
reusable stack arg area bytes has already been sufficiently aligned by
LowerFormalArguments, so growing NumBytes up to StackAlign is enough to
consume that excess. Otherwise (e.g. a plain C-convention call, forced
off the sibcall path, as in the aarch64_inout_za tests), we can't rely
on either having been pre-aligned, so we round NumBytes up to the same
residue mod StackAlign as NumReusableBytes, which cancels the residue
out of their difference (FPDiff), thus keeping the stack aligned going
into the callee.


    [11 lines not shown]
DeltaFile
+108-0llvm/test/CodeGen/AArch64/swifttail-fpdiff-align.ll
+21-16llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+35-0llvm/test/CodeGen/AArch64/sme-za-tailcall-fpdiff-align.ll
+21-0llvm/test/CodeGen/AArch64/tail-call-stack-args.ll
+185-164 files

LLVM/project 2dbfa63lldb/source/Expression IRExecutionUnit.cpp

[lldb] Get IRExecutionUnit mangling-mode from llvm::Module. (#224595)

Get the mangling mode (IRExecutionUnit::m_strip_underscore) from the
llvm::Module at IRExecutionUnit construction time, rather than getting
it from the llvm::ExecutionEngine in GetRunnableInfo.

This is a step towards decoupling IRExecutionUnit from
llvm::ExecutionEngine / MCJIT.
DeltaFile
+3-3lldb/source/Expression/IRExecutionUnit.cpp
+3-31 files

LLVM/project eab565allvm/lib/Target/AArch64 AArch64ISelLowering.cpp, llvm/test/CodeGen/AArch64 arm64ec-varargs.ll sme-za-tailcall-fpdiff-align.ll

Reland "[llvm][AArch64] Ensure stack alignment in non-sibcall tail calls with FPDiff" (#220406)

When a caller has a non-multiple of the minimum stack alignment more
argument stack space than the callee it is tail calling, we need to ensure that
the resulting FPDiff's magnitude has been rounded up to a multiple of the
platform's minimum stack alignment.

In this re-land there is a fixup to 234ce03692ede13ffd2fcb35570d801c1e332814,
which, because of the wrong order, wasn't actually moving NumBytes after
FPDiff had been re-aligned.

rdar://184474075
(cherry picked from commit 393710bbf74c4e7b92226603a18ead0bba70a8a0)
DeltaFile
+79-0llvm/test/CodeGen/AArch64/sme-za-tailcall-fpdiff-align.ll
+31-0llvm/test/CodeGen/AArch64/arm64ec-varargs.ll
+10-4llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+120-43 files

LLVM/project bb3517eutils/bazel/llvm-project-overlay/clang BUILD.bazel

[Bazel] Fixes 3e93e93 (#224771)

This fixes 3e93e9368f9167e5129f369194db08edcdf167d6 (#224692).

Buildkite error link:
https://buildkite.com/llvm-project/upstream-bazel/builds?commit=3e93e9368f9167e5129f369194db08edcdf167d6

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+1-0utils/bazel/llvm-project-overlay/clang/BUILD.bazel
+1-01 files

LLVM/project 267a9fbclang/lib/Lex ModuleMap.cpp, clang/test/Modules pr215931.m

[clang][modulemap] Fix crashes loading pcms (#218011)

Previously in the case that the directory was missing, loading a pcm
would crash. Now it attempts to load absolute paths first, and
gracefully ignores missing directories.

Follow up to https://github.com/llvm/llvm-project/pull/181916

Fixes: https://github.com/llvm/llvm-project/issues/215931

Assisted By: codex

(cherry picked from commit cd1abefa98daa37334eb4f8e48f1956fde859b1a)
DeltaFile
+38-0clang/test/Modules/pr215931.m
+12-10clang/lib/Lex/ModuleMap.cpp
+50-102 files

LLVM/project 36e7268lldb/source/Target TargetProperties.td

[lldb] Disable delayed-breakpoints by default for lldb 23

https://github.com/llvm/llvm-project/pull/192971 added a delayed
breakpoints feature, which delays sending the breakpoint management
packets until we actually continue the process. The feature itself
is working, but it has made it easier to hit a bunch of pre-existing
issues handling reads and writes around breakpoints.

https://github.com/llvm/llvm-project/issues/217359,
https://github.com/llvm/llvm-project/issues/217840,
https://github.com/llvm/llvm-project/issues/217359,
https://github.com/llvm/llvm-project/issues/205120 and
https://github.com/llvm/llvm-project/issues/202672
(reported by a downstream project as https://github.com/llvm/llvm-project/issues/216000)

These are all now fixed on the main branch, but it would
be a large backport to bring them over. Whereas this change
is a single line.


    [6 lines not shown]
DeltaFile
+1-1lldb/source/Target/TargetProperties.td
+1-11 files

LLVM/project 761d966clang/lib/CIR/Dialect/IR CIRDialect.cpp, clang/lib/CIR/Dialect/Transforms LoweringPrepare.cpp

[CIR] Harden static-local lowering against malformed .cir (#224744)

Enforce that a `static_local_guard` is always paired with a
`static_local_info` attribute via a GlobalOp verifier.
DeltaFile
+24-0clang/test/CIR/IR/invalid-static-local-info.cir
+9-1clang/test/CIR/IR/static-local.cir
+8-1clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp
+8-0clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+2-2clang/test/CIR/IR/static-local-info.cir
+3-0clang/test/CIR/IR/invalid-static-local.cir
+54-41 files not shown
+55-47 files

LLVM/project 664808clibcxx/include/__configuration compiler.h

[libc++] Reword confusing warning message about AppleClang version (#222380)

AppleClang 26.4 is not a thing -- it's AppleClang 21.0 that shipped with
Xcode 26.4.

(cherry picked from commit 9e39a5e4a606e2ef8e46bd4a947f0b39feacecc7)
DeltaFile
+1-1libcxx/include/__configuration/compiler.h
+1-11 files

LLVM/project 265c5b6compiler-rt/lib/scudo/standalone/tests secondary_test.cpp

[scudo] Fix AllocatorCacheMaxResidentBytesDisabled test (#224698)

The test made an implicit assumption about how the maps were created. On
a device where the page size is much greater than 4096, the test fails
because of the hard-coded limits. Make the limits and values depend on
page size to avoid this problem.
DeltaFile
+7-4compiler-rt/lib/scudo/standalone/tests/secondary_test.cpp
+7-41 files

LLVM/project 9dd5251flang/lib/Semantics check-omp-variant.cpp, flang/test/Semantics/OpenMP metadirective-construct-paths.f90

Count all enclosing leaves in reachable paths

Reachability must use the same construct positions and depth as lowering
when ranking metadirective replacements. Count source constructs without
selector traits, including leaves of combined directives, while keeping
NOTHING transparent.

Add regressions for actual and dynamically selected TASK regions and
DISTRIBUTE within TEAMS DISTRIBUTE PARALLEL DO.
DeltaFile
+53-0flang/test/Semantics/OpenMP/metadirective-construct-paths.f90
+17-4flang/lib/Semantics/check-omp-variant.cpp
+70-42 files

LLVM/project c951cdaflang/lib/Semantics openmp-utils.cpp, flang/test/Semantics/OpenMP metadirective-common.f90

Reject negative trait scores during metadirective recovery

Reachability analysis can rank candidates before CheckTraitScore diagnoses
invalid scores. A score of -1 wraps the initial unsigned score to zero,
causing selection to dereference a null best candidate.

Treat negative scores as absent during recovery while preserving the
existing diagnostic.
DeltaFile
+27-0flang/test/Semantics/OpenMP/metadirective-common.f90
+4-1flang/lib/Semantics/openmp-utils.cpp
+31-12 files

LLVM/project 609668cflang/lib/Semantics check-omp-variant.cpp, flang/test/Semantics/OpenMP metadirective-construct-paths.f90

Preserve OpenMP variant ranking and reachability

Incorrect scores and premature candidate rejection can change lowering
selection or suppress required metadirective loop diagnostics.

Preserve full score values and context-dependent device weights, retain
paths distinguished by those weights, and let runtime conditions satisfy
match_any despite unknown static properties.
DeltaFile
+68-0flang/test/Semantics/OpenMP/metadirective-construct-paths.f90
+1-8flang/lib/Semantics/check-omp-variant.cpp
+69-82 files

LLVM/project 82ae8f8flang/lib/Semantics check-omp-structure.h check-omp-variant.cpp, flang/test/Semantics/OpenMP metadirective-loop-applicability.f90

Remove redundant handling, improve style, and add documentation
DeltaFile
+13-21flang/lib/Semantics/check-omp-variant.cpp
+8-4flang/test/Semantics/OpenMP/metadirective-loop-applicability.f90
+6-4flang/lib/Semantics/check-omp-structure.h
+27-293 files

LLVM/project e00df19flang/lib/Semantics check-omp-variant.cpp, flang/test/Semantics/OpenMP metadirective-ordered-paths.f90 metadirective-loop-applicability.f90

Fix extension matching and reachable path merging

Metadirective semantic checking relies on ranked selection to decide which
replacements need validation. With match_any and match_none, a selector can
remain applicable even when some construct traits are absent. The existing
matching and path-merging assumptions do not fully account for this, so
ranking can crash or discard a reachable replacement, allowing invalid loop
nests to pass unchecked.

Make applicability, scoring, and reachable-path merging agree on what these
matching extensions can observe. Preserve enough construct context to rank
partially matching selectors and distinguish paths whose nesting changes
the selected replacement. That context must also remain visible inside a
BLOCK associated with a selected directive, so nested metadirectives are
checked against the context in which they can execute.
DeltaFile
+53-34flang/lib/Semantics/check-omp-variant.cpp
+71-0flang/test/Semantics/OpenMP/metadirective-match-any-paths.f90
+68-0flang/test/Semantics/OpenMP/metadirective-loop-applicability.f90
+45-0flang/test/Semantics/OpenMP/metadirective-ordered-paths.f90
+237-344 files

LLVM/project 35d4cc4flang/lib/Semantics check-omp-structure.h check-omp-variant.cpp, flang/test/Semantics/OpenMP metadirective-loop-applicability-openmp-60.f90 metadirective-loop-applicability.f90

Fix metadirective reachable path boundaries

Stop construct trait paths at the innermost target and retain the implicit
nothing fallback during unsupported-selector recovery.

Add coverage for actual and selected target boundaries and for nested
metadirectives reached through implicit fallback.
DeltaFile
+23-13flang/lib/Semantics/check-omp-variant.cpp
+32-0flang/test/Semantics/OpenMP/metadirective-loop-applicability.f90
+16-0flang/test/Semantics/OpenMP/metadirective-loop-applicability-openmp-60.f90
+2-0flang/lib/Semantics/check-omp-structure.h
+73-134 files

LLVM/project 7b27b05flang/lib/Semantics openmp-utils.cpp, flang/test/Semantics/OpenMP metadirective-loop-applicability-apply.f90 metadirective-ordered-paths.f90

Preserve metadirective selection semantics

Reachability checks can miss required loop diagnostics when selection
drops SIMD traits or treats NOTHING with APPLY as a no-op.

Preserve those distinctions in the shared selection plan so semantic
checks retain reachable transformations and lowering diagnoses
unsupported cases.
DeltaFile
+185-0flang/test/Semantics/OpenMP/metadirective-construct-paths.f90
+106-5flang/test/Semantics/OpenMP/metadirective-loop-applicability-openmp-60.f90
+0-71flang/test/Semantics/OpenMP/metadirective-match-any-paths.f90
+28-21flang/lib/Semantics/openmp-utils.cpp
+0-45flang/test/Semantics/OpenMP/metadirective-ordered-paths.f90
+0-23flang/test/Semantics/OpenMP/metadirective-loop-applicability-apply.f90
+319-1656 files not shown
+366-17412 files

LLVM/project 57a328aflang/include/flang/Semantics openmp-utils.h, flang/lib/Semantics openmp-utils.cpp check-omp-variant.cpp

Respect target boundaries during OpenMP variant lowering

Stop collecting construct traits at the innermost TARGET so lowering
agrees with semantic analysis when selecting metadirective replacements
and DECLARE VARIANT callees.
DeltaFile
+5-6flang/lib/Semantics/check-omp-variant.cpp
+2-6flang/lib/Semantics/openmp-utils.cpp
+4-4flang/test/Semantics/OpenMP/metadirective-construct-paths.f90
+4-3flang/test/Lower/OpenMP/metadirective-target-boundary.f90
+1-2flang/test/Lower/OpenMP/metadirective-construct.f90
+2-1flang/include/flang/Semantics/openmp-utils.h
+18-226 files