LLVM/project feb62bb — lld/MachO Symbols.h Relocations.h

[lld][MachO] Avoid redundant work in Writer::scanRelocations()

During relocation scanning, `Writer::scanRelocations()` looks up
`target->getRelocAttrs(r.type)` up to three times per symbol relocation
(in `scanRelocations()`, `validateSymbolRelocation()`, and
`prepareSymbolRelocation()`), tests `r.referent` twice for symbol
referents, and makes an out-of-line call to `validateSymbolRelocation()`
on every symbol relocation even though it only rejects two rare
thread-local-variable cases.

Move `validateSymbolRelocation()` (whose only caller is
`Writer::scanRelocations()`) into `Writer.cpp`, split the rare TLV
validation logic into a `LLVM_ATTRIBUTE_NOINLINE` helper, and mark
`DylibSymbol` `final` so `dysym->isTlv()` avoids a virtual call on the
fast path. Fetch `RelocAttrs` once per relocation, pass it to
`validateSymbolRelocation()` and `prepareSymbolRelocation()`, hoist
loop-invariant `target->relocAttrs` and `config->emitChainedFixups`, and
dispatch on `r.referent` once for non-subtractor relocations.
DeltaFile
+74-12lld/MachO/Writer.cpp
+0-47lld/MachO/Relocations.cpp
+6-1lld/MachO/Target.h
+0-3lld/MachO/Relocations.h
+1-1lld/MachO/Symbols.h
+81-645 files

LLVM/project 2510c11 — llvm/lib/Target/AArch64 AArch64TargetTransformInfo.cpp, llvm/test/Transforms/SLPVectorizer/AArch64 non-power-of-2-with-adjusted-gathers.ll store-chain-split-wide-stored-values.ll

[𝘀𝗽𝗿] initial version

Created using spr 2.0.0-beta.1
DeltaFile
+53-120llvm/test/Transforms/SLPVectorizer/AArch64/or-reduction-byte-pack.ll
+53-57llvm/test/Transforms/SLPVectorizer/AArch64/reassoc-copyable-sched-deps.ll
+57-21llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+24-23llvm/test/Transforms/SLPVectorizer/AArch64/loop-accumulator-reduction.ll
+14-32llvm/test/Transforms/SLPVectorizer/AArch64/store-chain-split-wide-stored-values.ll
+22-22llvm/test/Transforms/SLPVectorizer/AArch64/non-power-of-2-with-adjusted-gathers.ll
+223-2756 files not shown
+288-32412 files

LLVM/project 9b1287d — compiler-rt/lib/sanitizer_common sanitizer_fuchsia.cpp sanitizer_suppressions.cpp, compiler-rt/test/ubsan/TestCases/Integer suppressions.cpp

[sanitizer] Ensure suppression files' buffer is null terminated. (#236826)

Function ReadFileToBuffer does not terminate string 'file_contents'.
SuppressionContext::Parse internal_strcspn expects a null-terminated
string.
The issue was found through static analysis.
DeltaFile
+5-8compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cpp
+8-0compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cpp
+5-0compiler-rt/test/ubsan/TestCases/Integer/suppressions.cpp
+18-83 files

LLVM/project e608c99 — llvm/include/llvm/CodeGen/GlobalISel LoadStoreOpt.h, llvm/include/llvm/ExecutionEngine/Orc ObjectLinkingLayer.h

[llvm] Remove unused forward declarations (NFC) (#246828)

This patch removes unused forward declarations of classes and structs
across llvm/ that are not referenced in the same file.

Assisted-by: Antigravity
DeltaFile
+0-5llvm/lib/Target/M68k/MCTargetDesc/M68kMCTargetDesc.h
+0-5llvm/include/llvm/SandboxIR/Tracker.h
+0-5llvm/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
+0-5llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
+0-4llvm/lib/Target/Xtensa/MCTargetDesc/XtensaMCTargetDesc.h
+0-4llvm/lib/IR/User.cpp
+0-28176 files not shown
+0-282182 files

LLVM/project 7d7d0d3 — compiler-rt/lib/sanitizer_common sanitizer_platform_limits_posix.h sanitizer_platform_limits_posix.cpp, compiler-rt/lib/tsan/rtl tsan_interceptors_posix.cpp

[tsan] Intercept C11 mtx_* functions on glibc (#239670)

glibc implements the C11 mutex functions with its internal pthread_mutex
functions, so TSan doesn't see C11 mutexes being locked and unlocked and
reports false data races on the data they protect (#199585).

Intercept mtx_init, mtx_destroy, mtx_lock, mtx_trylock, mtx_timedlock
and mtx_unlock, forwarding to the real functions and doing what the
pthread_mutex interceptors do. mtx_recursive makes the mutex reentrant.

To avoid hardcoding C11 constants, forward mtx_plain, mtx_recursive and
mtx_timed enum values to sanitizer_platform_limits_posix.

Enable c11_mtx.c for TSan on glibc.

Assisted-by: Claude
DeltaFile
+62-0compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
+16-0compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+4-0compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+0-2compiler-rt/test/sanitizer_common/TestCases/Posix/c11_mtx.c
+82-24 files

LLVM/project d2ed2b7 — llvm/lib/Transforms/Instrumentation SanitizerCoverage.cpp, llvm/test/Instrumentation/SanitizerCoverage missing_dbg.ll

[SanitizerCoverage] Use InstrumentationIRBuilder for gated callbacks (#244789)

Gated callback paths in InjectTraceForSwitch(), InjectTraceForCmp(), and
InjectCoverageAtBlock() used a plain IRBuilder instead of
InstrumentationIRBuilder, and InjectCoverageAtBlock() did not propagate
EntryLoc. When the split point has no debug location in a function with
a DISubprogram, the inserted runtime call lacked a !dbg location.

Assisted-by: Gemini
DeltaFile
+36-32llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
+22-31llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
+58-632 files

LLVM/project 4af237e — llvm/lib/Transforms/Vectorize VPlanLowering.cpp VPlanConstruction.cpp, llvm/test/Transforms/LoopVectorize alias-mask.ll runtime-checks-hoist.ll

[LV] Expand runtime checks in SafeUDivMode. (#246863)

The SCEV predicate checks, memory runtime checks and alias-mask checks
are executed unconditionally before the vector loop, but may contain a
udiv that the original loop only evaluates in a predicated block, e.g.
for an address computed from a udiv under a condition that is never
true. Expanding it unguarded divides by zero or poison.

Expand them in SafeUDivMode, matching the expansion of
VPExpandSCEVRecipes. canExpandInIR no longer bails out in SafeUDivMode,
as it only accepts expressions that cannot cause UB, so hoisting of
memory checks out of outer loops is unchanged.

PR: https://github.com/llvm/llvm-project/pull/246863
DeltaFile
+211-0llvm/test/Transforms/LoopVectorize/runtime-checks-predicated-udiv.ll
+24-22llvm/test/Transforms/LoopVectorize/VPlan/memory-checks.ll
+3-1llvm/test/Transforms/LoopVectorize/runtime-checks-hoist.ll
+2-1llvm/test/Transforms/LoopVectorize/alias-mask.ll
+2-1llvm/lib/Transforms/Vectorize/VPlanLowering.cpp
+2-1llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+244-262 files not shown
+247-288 files

LLVM/project ec153d7 — compiler-rt/lib/sanitizer_common sanitizer_platform_interceptors.h

[NFC][sanitizer_common] Flip the AIX build guard to positive (#246155)

https://github.com/llvm/llvm-project/pull/138606 added build guard
`SI_NOT_AIX`. It's a negative flag and easy to cause confusing on
double-negative.

This PR flips the flag to positive and updates all of the usages.

Assisted-by: Gemini
DeltaFile
+19-19compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+19-191 files

LLVM/project e2a85c2 — clang/lib/CodeGen CodeGenFunction.h CGExprCXX.cpp, clang/test/CodeGenCXX target-features-error.cpp

[Clang][CodeGen] Plumb SourceLocation to virtual dtor and thunk calls (#245522)

Forward the call or delete expression location through
EmitCXXDestructorCall
and EmitVirtualDestructorCall, and pass the method location from
getOrCreateVirtualFunctionPointerThunk to EmitCall.

Previously, these paths passed an empty SourceLocation to EmitCall,
causing
call-site diagnostics such as target-feature errors on virtual
destructors
(both Itanium and Microsoft ABIs) to be emitted without a file or line
number. This also prepares for passing call-site locations to UBSan kCFI
diagnostics in follow-up changes.

Assisted-by: Gemini
DeltaFile
+9-7clang/lib/CodeGen/MicrosoftCXXABI.cpp
+14-0clang/test/CodeGenCXX/target-features-error.cpp
+6-4clang/lib/CodeGen/ItaniumCXXABI.cpp
+4-4clang/lib/CodeGen/CGExprCXX.cpp
+1-0clang/lib/CodeGen/CodeGenFunction.h
+34-155 files

LLVM/project a37c671 — llvm/lib/CodeGen TargetInstrInfo.cpp, llvm/test/CodeGen/X86 machine-outliner-nomerge.ll

[CodeGen][MachineOutliner] Do not outline nomerge instructions (#245435)

Instructions carrying MachineInstr::NoMerge must retain distinct call or
trap addresses so crash reports and debuggers can attribute faults to
specific sites. Classify NoMerge instructions as Illegal in
TargetInstrInfo::getOutliningType so MachineOutliner does not merge them
into shared outlined functions.

Assisted-by: Gemini
DeltaFile
+8-4llvm/test/CodeGen/X86/machine-outliner-nomerge.ll
+3-0llvm/lib/CodeGen/TargetInstrInfo.cpp
+11-42 files

LLVM/project 75f4eea — llvm/lib/Transforms/IPO AttributorAttributes.cpp, llvm/test/Transforms/Attributor value-simplify-call-site-returned.ll

[Attributor] Use call site values when the callee returns an argument

AAPotentialValuesCallSiteReturned takes the interprocedural values of a call
from the interprocedural return values of the callee. If the callee returns one
of its arguments, these values contain the arguments of all call sites, so each
call result also gets the values passed at all other call sites. This is not
necessary. If the callee has many call sites and the call results are passed to
other calls, the value sets also become very large.

If the callee returns only its arguments and constants, we just need to
translate these values to the call site for the interprocedural scope.

This PR was assisted by AI but I reviewed all the changes.
DeltaFile
+47-0llvm/test/Transforms/Attributor/value-simplify-call-site-returned.ll
+33-12llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+80-122 files

LLVM/project fc486c8 — llvm/test/CodeGen/AMDGPU srem.ll load-global-i8.ll, llvm/test/CodeGen/RISCV clmul.ll

[spr] update

Created using spr 2.0.0-beta.2
DeltaFile
+4,870-4,906llvm/test/CodeGen/AMDGPU/memintrinsic-unroll.ll
+11-7,563mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
+3,141-3,182llvm/test/CodeGen/RISCV/clmul.ll
+2,602-2,926llvm/test/CodeGen/X86/vector-compress.ll
+0-5,394llvm/test/CodeGen/AMDGPU/load-global-i8.ll
+0-5,274llvm/test/CodeGen/AMDGPU/srem.ll
+10,624-29,2458,539 files not shown
+366,378-291,7658,545 files

LLVM/project e875fd6 — llvm/test/Instrumentation/SanitizerCoverage missing_dbg.ll

[test][SanitizerCoverage] Precommit gated-callbacks debug info test (#245528)

Add a gated-callbacks RUN line to missing_dbg.ll showing that gated
runtime calls currently drop !dbg locations in functions with debug
info.

Assisted-by: Gemini
DeltaFile
+250-0llvm/test/Instrumentation/SanitizerCoverage/missing_dbg.ll
+250-01 files

LLVM/project 50f5329 — llvm/lib/Target/SystemZ SystemZISelLowering.h SystemZISelLowering.cpp, llvm/test/CodeGen/SystemZ clmul-novec.ll clmul.ll

[SystemZ] Lower llvm.clmul with VGFM

Mark ISD::CLMUL and ISD::CLMULH Custom for i32, i64, v16i8, v8i16,
v4i32 and v2i64 when the vector facility is available, and select them
with VGFM{B,H,F,G}. i8/i16 are promoted to i32 by the generic
legalizer. CLMULR is built from CLMUL and CLMULH by the generic
expansion.

VGFM XORs the products of each even/odd element pair, so a vector
multiply masks one operand to the even and odd elements, issues two
VGFMs, and permutes the requested half of each product into place.
Scalars use VGFMG on (x, 0) vectors.

llvm.clmul.i64 previously expanded to ~66 instructions and
<2 x i64> to ~380.

Multiplication by a mask of 2^N trailing ones is a prefix XOR and stays
on the generic GPR shift/XOR expansion. For i8/i16 this is decided in
ReplaceNodeResults, before promotion widens the mask. This keeps the

    [3 lines not shown]
DeltaFile
+392-0llvm/test/CodeGen/SystemZ/clmul.ll
+126-0llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+15-0llvm/test/CodeGen/SystemZ/clmul-novec.ll
+1-0llvm/lib/Target/SystemZ/SystemZISelLowering.h
+534-04 files

LLVM/project 579a431 — llvm/test/Instrumentation/MemorySanitizer/X86 avx512-origins.ll

[test][msan] Add AVX512 origin test for PMOV mem intrinsics (#246150)

Add avx512-origins.ll for origin tracking corner cases of AVX512
intrinsics; shadow propagation stays in avx512*-intrinsics.ll.

Start with PMOV mem intrinsics, which are currently strictly handled:
each destination element width, a store smaller than an origin slot,
the widest store, and an aligned destination, so the upcoming handler
change shows the origin diff.

Needed by #240973.

Assisted-by: Gemini
DeltaFile
+192-0llvm/test/Instrumentation/MemorySanitizer/X86/avx512-origins.ll
+192-01 files

LLVM/project 3f7b275 — clang/include/clang/AST NestedNameSpecifier.h

[clang] Add IWYU export pragma to NestedNameSpecifier.h (NFC) (#246865)

This patch adds an IWYU export pragma for NestedNameSpecifierBase.h in
NestedNameSpecifier.h.  Without this patch, clang-include-cleaner
treats transitive includes of NestedNameSpecifierBase.h as sufficient
for NestedNameSpecifier uses and flags NestedNameSpecifier.h as unused.

Note that #159154 already added the same pragma to Type.h for
TypeBase.h.

Assisted-by: Antigravity
DeltaFile
+1-1clang/include/clang/AST/NestedNameSpecifier.h
+1-11 files

LLVM/project cf1ca3c — clang/lib/AST TypePrinter.cpp, clang/lib/Sema SemaWasm.cpp SemaTemplateDeduction.cpp

[clang] Remove unused includes (NFC) (#246829)

This patch removes unused #include directives across .cpp files under
clang/.  Identified by clang-include-cleaner and verified locally.

Assisted-by: Antigravity
DeltaFile
+0-2clang/lib/Sema/AnalysisBasedWarnings.cpp
+0-2clang/lib/AST/TypePrinter.cpp
+0-1clang/lib/Sema/SemaWasm.cpp
+0-1clang/lib/Sema/SemaTemplateDeduction.cpp
+0-1clang/lib/Sema/SemaTemplate.cpp
+0-1clang/lib/Sema/SemaSYCL.cpp
+0-817 files not shown
+0-2523 files

LLVM/project 60cd43d — compiler-rt/lib/tsan/rtl tsan_interceptors_posix.cpp, compiler-rt/test lit.common.cfg.py

[tsan] Intercept pthread_clockjoin_np on Linux (#240051)

glibc 2.31 introduced pthread_clockjoin_np. Without an interceptor,
joining a thread via pthread_clockjoin_np does not consume its user_id
from ThreadRegistry::live_. When glibc subsequently reuses the pthread_t
value for a new thread, ThreadCreate trips a CHECK-abort on the
duplicate user_id in live_.try_emplace.

Add TSAN_INTERCEPTOR for pthread_clockjoin_np on Linux, register glibc
2.31 in lit configuration, and add a regression test covering timeout,
synchronization, and thread reuse across clocks.

Fixes #239326

Assisted-by: Antigravity
DeltaFile
+49-0compiler-rt/test/tsan/Linux/thread_clockjoin.c
+22-2compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
+1-0compiler-rt/test/lit.common.cfg.py
+72-23 files

LLVM/project d03d79a — clang/lib CMakeLists.txt

[CMake] Enable -Werror=global-constructors for clang/lib (#246753)

Like #239678, enforce
llvm.org/docs/CodingStandards.html#do-not-use-static-constructors in
Clang builds for clang/lib source files.

List the libraries that still have C++ dynamic initializations so that
the others cannot gain new ones.

Examples: Remove cl::opt, make the constructor `constexpr` (#223903),
move globals with ctor/dtor out of headers, or into a function-local
static (#234442)

LLM-aided
DeltaFile
+38-0clang/lib/CMakeLists.txt
+38-01 files

LLVM/project 66ca2a9 — lldb/include/lldb lldb-enumerations.h, lldb/include/lldb/Interpreter CommandOptionArgumentTable.h

[lldb] Declare darwin-log enable options in TableGen

The --filter option of `plugin structured-data darwin-log enable` took
eArgRawInput, which describes free-form text passed after ' -- ' and so
contradicts how the option works: each --filter takes one rule, which
must be quoted if it contains spaces, and the option may be repeated.

Replace it with the newly introduced eArgTypeDarwinLogFilter and declare
the options of the command in TableGen like the other commands.

This was the only use of eArgRawInput as an argument type. The
corresponding entry in the option argument table is kept so that
`help raw-input` still works.

The multi-line description of --filter contains manual formatting, but
apparently it has been broken since 23dffff4 (tracked by #246769).

Assisted-by: Claude
DeltaFile
+103-0lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLogOptions.td
+4-98lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
+16-0lldb/test/API/commands/help/TestHelp.py
+5-0lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt
+1-0lldb/include/lldb/lldb-enumerations.h
+1-0lldb/include/lldb/Interpreter/CommandOptionArgumentTable.h
+130-986 files

LLVM/project d5a36ad — lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime CMakeLists.txt AppleObjCRuntimeOptions.td

[lldb] Declare objc class-table dump options in TableGen (NFC)

Assisted-by: Claude
DeltaFile
+4-12lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+7-0lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
+7-0lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeOptions.td
+18-123 files

LLVM/project 50e580c — lldb/source/Target CMakeLists.txt TargetOptions.td

[lldb] Declare OptionGroupPlatform options in TableGen (NFC)

Add TargetOptions.td for the options of the option groups in
lldbTarget and move the options of RSync/Caching/SSH there.

Assisted-by: Claude
DeltaFile
+8-31lldb/source/Target/Platform.cpp
+32-0lldb/source/Target/TargetOptions.td
+5-0lldb/source/Target/CMakeLists.txt
+45-313 files

LLVM/project 0adc72d — lldb/include/lldb/Interpreter CommandOptionArgumentTable.h, lldb/include/lldb/Target Target.h

[lldb] Declare OptionGroupValueObjectDisplay options in TableGen

The --dynamic-type option is an enum, but it was declared without an
argument type, so `help` printed "-d <none>" and the option was not
described as an enumeration:
```
$ (lldb) help dwim-print
       -d <none> ( --dynamic-type <none> )
            Show the object as its full dynamic type, not its static
            type, if available.
            Values: no-dynamic-values | run-target | no-run-target
$ (lldb) help <dynamic-value-type>
error: '<dynamic-value-type>' is not a known command.
```

This is now fixed, as shown in the added test.

Assisted-by: Claude
DeltaFile
+69-0lldb/source/Interpreter/InterpreterOptions.td
+9-44lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
+0-23lldb/source/Target/Target.cpp
+20-0lldb/include/lldb/Interpreter/CommandOptionArgumentTable.h
+17-0lldb/test/API/commands/help/TestHelp.py
+0-2lldb/include/lldb/Target/Target.h
+115-691 files not shown
+116-697 files

LLVM/project cfb9719 — lldb/include/lldb/Interpreter CommandOptionArgumentTable.h, lldb/source/Interpreter InterpreterOptions.td OptionGroupWatchpoint.cpp

[lldb] Declare OptionGroupWatchpoint options in TableGen

Add eArgTypeWatchType to the argument table so that `help watch-type`
can find it and print the valid values.

Assisted-by: Claude
DeltaFile
+6-43lldb/source/Interpreter/OptionGroupWatchpoint.cpp
+25-1lldb/include/lldb/Interpreter/CommandOptionArgumentTable.h
+15-0lldb/test/API/commands/help/TestHelp.py
+15-0lldb/source/Interpreter/InterpreterOptions.td
+61-444 files

LLVM/project a24a445 — lldb/source/Interpreter OptionGroupVariable.cpp

Use GetDefinitions() to avoid index calculation, move static_assert
DeltaFile
+9-17lldb/source/Interpreter/OptionGroupVariable.cpp
+9-171 files

LLVM/project 15986b8 — lldb/source/Interpreter InterpreterOptions.td OptionGroupVariable.cpp

[lldb] Declare OptionGroupVariable options in TableGen (NFC)

GetDefinitions() omits the four frame-only options by dropping the
leading definitions. Make sure TableGen emits them first by giving
their `def`s appropriate names.

--regex options takes no argument (it is a boolean flag) but was
declared with eArgTypeRegularExpression. It is eArgTypeNone now.

Assisted-by: Claude
DeltaFile
+10-105lldb/source/Interpreter/OptionGroupVariable.cpp
+47-0lldb/source/Interpreter/InterpreterOptions.td
+57-1052 files

LLVM/project 4cec542 — lldb/source/Interpreter InterpreterOptions.td OptionGroupFormat.cpp

[lldb] Declare OptionGroupFormat options in TableGen

Declare the options in alphabetical order and adjust C++ counterpart
accordingly, since it relies on the order of options to "hide" some of
them. Use named positions instead of the hardcoded 0...3.

Assisted-by: Claude
DeltaFile
+26-22lldb/source/Interpreter/OptionGroupFormat.cpp
+23-0lldb/source/Interpreter/InterpreterOptions.td
+49-222 files

LLVM/project 29feb57 — lldb/source/Interpreter OptionGroupPlatform.cpp

Use GetDefinitions() to avoid index calculation
DeltaFile
+1-4lldb/source/Interpreter/OptionGroupPlatform.cpp
+1-41 files

LLVM/project 25d02b8 — llvm/test/CodeGen/X86 combine-funnel-shifts.ll

[X86] Add tests showing failure to fold fsh(X,Y,undef/poison) (#246870)

Prep work for #246251
DeltaFile
+49-0llvm/test/CodeGen/X86/combine-funnel-shifts.ll
+49-01 files

LLVM/project bf19771 — llvm/test/CodeGen/X86 combine-rotates.ll

[X86] Add tests showing failure to fold rot(X,undef/poison) (#246867)

Prep work for #246251
DeltaFile
+24-0llvm/test/CodeGen/X86/combine-rotates.ll
+24-01 files