LLVM/project 1d0b606compiler-rt/lib/tsan/rtl tsan_interceptors_mach_vm.cpp, compiler-rt/test/tsan/Darwin mach_vm_deallocate_race.c

[Darwin][TSan] Fix race in mach_vm_deallocate interceptor (#210716)

I have seen an issue whereby the meta store in MetaMap::AllocBlock lands
in the unmapped gap left during the tsan::MetaMap::ResetRange call;
where the range is first unmapped, and then remapped with MAP_FIXED.
This occurred under the mach_vm_deallocate interceptor, because it first
does the deallocate call, and only then does it call UnmapShadow -
leaving a gap where a fresh slab for malloc can land, only to have the
meta region for that range mapped out from under it, resulting in a bad
access fault.

It is worth noting that there is a comment above the IsValidMmapRange
function (which gets called during UnmapShadow), that describes this
exact issue in the context of munmap.

rdar://179172055

Assisted by: Claude
DeltaFile
+57-0compiler-rt/test/tsan/Darwin/mach_vm_deallocate_race.c
+2-3compiler-rt/lib/tsan/rtl/tsan_interceptors_mach_vm.cpp
+59-32 files

LLVM/project 2cd5deblibcxx/utils test-at-commit

[libc++] Fix test-at-commit after df4bb1f3106d (#210983)
DeltaFile
+0-2libcxx/utils/test-at-commit
+0-21 files

LLVM/project 3638f27mlir/lib/Dialect/Math/IR MathOps.cpp, mlir/test/Dialect/Math canonicalize.mlir

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+18-12mlir/lib/Dialect/Math/IR/MathOps.cpp
+16-4mlir/test/Dialect/Math/canonicalize.mlir
+34-162 files

LLVM/project 14cb461llvm/utils/gn/secondary/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime BUILD.gn

[gn build] Port 1a11f6ca1779 (#210974)
DeltaFile
+0-1llvm/utils/gn/secondary/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/BUILD.gn
+0-11 files

LLVM/project 114372allvm/utils/gn/secondary/llvm/utils/TableGen/Basic BUILD.gn

[gn build] Port 30c0454414ec (#210975)
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/utils/TableGen/Basic/BUILD.gn
+1-01 files

LLVM/project 11a6145llvm/utils/gn/secondary/llvm/lib/Transforms/Vectorize BUILD.gn

[gn build] Port 921f4da4a05f (#210976)
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/lib/Transforms/Vectorize/BUILD.gn
+1-01 files

LLVM/project 0e678e9llvm/utils/gn/secondary/llvm/lib/Transforms/Vectorize BUILD.gn

[gn build] Port ea205541b987 (#210977)
DeltaFile
+1-0llvm/utils/gn/secondary/llvm/lib/Transforms/Vectorize/BUILD.gn
+1-01 files

LLVM/project 42972f5clang/include/clang/CIR/Dialect/IR CIRAttrs.td, clang/lib/CIR/CodeGen CIRGenModule.cpp CIRGenExprConstant.cpp

[CIR] Introduce data_member_offset attribute (#208777)

Some fields, like no_unique_address marked ones, aren't present in the
CIR struct type. This attribute represents an offset into a struct
instead, since get_member isn't possible without a member.

I also considered representing these types in the struct, but it ends up
causing a lot of awful looking structs, and forces the LLVMIR to contain
empty fields for each of these, but not in lexical order, which is
particularly awful looking.

I considered making this part of data-member, but it seems like not a
particularly good idea, since this isn't really getting a 'member' in
the traditional sense.
DeltaFile
+55-15clang/test/CIR/CodeGen/pointer-to-empty-data-member.cpp
+39-0clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
+18-7clang/lib/CIR/CodeGen/CIRGenModule.cpp
+15-0clang/lib/CIR/Dialect/Transforms/TargetLowering/LowerItaniumCXXABI.cpp
+10-4clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
+8-1clang/lib/CIR/Dialect/Transforms/CXXABILowering.cpp
+145-273 files not shown
+161-289 files

LLVM/project 4aa8d56llvm/include/llvm/IR IntrinsicsAArch64.td

[LLVM][SVE] Convert FFR intrinsic definition to use IntrRead/IntrWrite. (#210084)

Follows on from https://github.com/llvm/llvm-project/issues/154144 to
better articulate the FFR intrinsics memory effects.

I've been deliberatly cautious with marking FFR as read/write for the
load intrinsics. There is an argument they could be write only but I'm
not looking to optimise FFR accesses at this stage.
DeltaFile
+9-8llvm/include/llvm/IR/IntrinsicsAArch64.td
+9-81 files

LLVM/project b1d21c6llvm/lib/Transforms/IPO ExpandVariadics.cpp, llvm/test/Transforms/ExpandVariadics spirv-printf.ll

[ExpandVariadics] Don't lower unmangled C printf on SPIR-V (#206998)

An unmangled C `printf` declaration demangles to bare `printf` (no
argument list), so `SPIRV::ignoreFunction`'s `printf(` prefix check
missed it and ExpandVariadics packed its arguments into a vararg buffer;
the SPIR-V backend then passed the buffer pointer as printf's first
variadic operand, so device printf printed pointer values instead of the
actual arguments. Match the bare name too so OpenCL/HIP printf (emitted
unmangled) is left as a variadic call for the backend's OpenCL.std
printf lowering.
DeltaFile
+35-0llvm/test/Transforms/ExpandVariadics/spirv-printf.ll
+6-1llvm/lib/Transforms/IPO/ExpandVariadics.cpp
+41-12 files

LLVM/project f90e121clang/lib/Driver/ToolChains Darwin.h Darwin.cpp, clang/test/Driver darwin-hip-spirv-version.hip

[Darwin] Use macOS product version in ensureTargetInitialized (#206902)

`Darwin::ensureTargetInitialized()` recorded the raw triple OS version
from `getOSVersion()`, which on macOS is the Darwin *kernel* version
(e.g. `24.3.0`), not the macOS *product* version (`15.x`). The offload
host job later calls `setTarget()` again from `AddDeploymentTarget()`
with the product version; `setTarget()`'s reinit guard only
short-circuits when the versions match, so the mismatch trips
`assert(!TargetInitialized && "Target already initialized!")` and clang
aborts on every `-x hip --offload=spirv64* --target=arm64-apple-darwin`
compile.

Convert macOS kernel versions via `getMacOSXVersion()` so the lazy init
records the same version `AddDeploymentTarget()` uses later.
DeltaFile
+33-0clang/test/Driver/darwin-hip-spirv-version.hip
+14-2clang/lib/Driver/ToolChains/Darwin.h
+14-1clang/lib/Driver/ToolChains/Darwin.cpp
+61-33 files

LLVM/project 27eeb73clang/test/Driver amdgpu-xnack-sramecc-flags.c, llvm/lib/Target/AMDGPU AMDGPUAsmPrinter.cpp

AMDGPU: Use module flags to control xnack and sramecc (#204595)

This ensures these ABI details are encoded in the IR module
rather than depending on external state from command-line flags.
Previously, these were encoded as function-level subtarget features.
The code object output was a single target ID directive implied
by the global subtarget. The backend would previously check if a
function's subtarget feature mismatched the global subtarget. This
is avoided by making xnack and sramecc module-level properties from
the start. This also provides proper linker compatibility
enforcement, moving the error point earlier.

The old encoding was also an abuse of the subtarget feature system.
Subtarget features are a bitvector, and later features in the string
can override earlier ones. The old handling added a special case
where explicit settings were preserved: ordinarily +feature,-feature
should result in the feature being disabled, but +xnack,-xnack would
preserve the explicit "-xnack" state, which differs from the absence
of any xnack setting.

    [24 lines not shown]
DeltaFile
+52-52llvm/test/CodeGen/AMDGPU/directive-amdgcn-target-legacy-triples.ll
+30-46llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+75-0llvm/test/CodeGen/AMDGPU/module-flag-xnack.ll
+36-33clang/test/Driver/amdgpu-xnack-sramecc-flags.c
+66-0llvm/test/CodeGen/AMDGPU/module-flag-sramecc.ll
+54-0llvm/test/CodeGen/AMDGPU/module-flag-xnack-no-on-off-modes.ll
+313-13193 files not shown
+1,154-36299 files

LLVM/project 1a11f6clldb/source/Plugins/LanguageRuntime/ObjC ObjCLanguageRuntime.h, lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime AppleObjCRuntimeV1.cpp AppleObjCRuntimeV1.h

[lldb] Delete AppleObjCRuntimeV1 (#203190)

This was used in older 32-bit ObjC programs, and it is not used anywhere
by the debugger.
DeltaFile
+0-430lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
+0-160lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
+5-9lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+3-3lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h
+0-1lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt
+8-6035 files

LLVM/project 3ed1836llvm/test/CodeGen/AArch64 aarch64-mops.ll, llvm/test/CodeGen/AArch64/GlobalISel inline-memmove.mir inline-memcpy.mir

[GlobalISel][AArch64] Add more memcpy and memmove tests (NFC) (#210263)

Test inlined memcpy and memmove operations with multiple loads/stores
with different sizes.

New IR tests added for size 7 to check which one of load/store sequences
we generate:

- 4 + 2 + 1 bytes
- 4 + 4 bytes (4 bytes at offset, 4 bytes at offset + 3)

We also didn't have the `memcpy_inline_...` tests for the
`memmove.inline` intrinsic. I've copied all `memcpy_inline_...` tests
for `memmove.inline`, with the exception of sizes 65, 64, and 63, as I'm
not sure whether they're useful. (the same edge cases are already
checked in tests with sizes 10 and 7)

List of all IR tests added:


    [13 lines not shown]
DeltaFile
+686-1llvm/test/CodeGen/AArch64/aarch64-mops.ll
+131-0llvm/test/CodeGen/AArch64/GlobalISel/inline-memmove.mir
+120-0llvm/test/CodeGen/AArch64/GlobalISel/inline-memcpy.mir
+937-13 files

LLVM/project 981735bllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/RISCV gathered-loads-interleave-factor-remainder.ll

[SLP]Fix crash on short interleaved gathered-load remainder

A trailing, undersized chunk could keep an InterleaveFactor too
large for it, so RISCVTTIImpl::getInterleavedMemoryOpCost divided
by it and built a zero-element vector type.

Fixes #210849

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/210965
DeltaFile
+142-0llvm/test/Transforms/SLPVectorizer/RISCV/gathered-loads-interleave-factor-remainder.ll
+5-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+147-12 files

LLVM/project 4258fa1llvm/include/llvm/IR RuntimeLibcalls.td, llvm/lib/Target/Hexagon HexagonSubtarget.cpp HexagonSubtarget.h

Hexagon: Stop excluding some generic compiler-rt functions from libcalls

RuntimeLibcalls should indicate any function that exists and is callable.
Historically the list of library functions was conflated with the library
functions which should be used, so the library definition was complicated
by excluding the overridden cases. My reading of the compiler-rt sources is
that the generically named functions are built alongside the __hexagon
prefixed variants. e.g., __divsi3 and __hexagon_divsi3 both exist.

It will simplify future libcall work the fewer special case target exclusions
there are, so allow the functions to be defined and apply the selection
preference for the __hexagon prefixed versions in LibcallLoweringInfo.

I do question why compiler-rt is built this way; why doesn't the hexagon
just replace the standard entrypoint names with the target implementations?

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+29-0llvm/lib/Target/Hexagon/HexagonSubtarget.cpp
+5-4llvm/include/llvm/IR/RuntimeLibcalls.td
+3-0llvm/lib/Target/Hexagon/HexagonSubtarget.h
+37-43 files

LLVM/project a83cc57clang/test/CodeGen ptr-subtract-stable.c

Attempt to fix buildbot failure (#210956)

Value names are discarded by default on build without asserts.
DeltaFile
+6-7clang/test/CodeGen/ptr-subtract-stable.c
+6-71 files

LLVM/project 4d4bf12llvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU llvm.amdgcn.buffer.atomic.illegal-data-type.err.ll

[AMDGPU] Reject illegal buffer atomic data widths in SelectionDAG (#210925)

Continuation of the fix introduced in #210366, but this time for
raw/struct buffer atomics instead of image atomics
DeltaFile
+53-0llvm/test/CodeGen/AMDGPU/llvm.amdgcn.buffer.atomic.illegal-data-type.err.ll
+22-0llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+75-02 files

LLVM/project 1ec9c0cllvm/test/CodeGen/AMDGPU llvm.log.ll llvm.log10.ll, llvm/test/CodeGen/AMDGPU/GlobalISel fshl.ll fshr.ll

Merge main into users/mariusz-sikora-at-amd/gfx13/add-builtins-intrinsics-v-cvt-scalef32-pk32-fp6-f32
DeltaFile
+3,024-2,355llvm/test/CodeGen/AMDGPU/GlobalISel/fshl.ll
+3,080-2,174llvm/test/CodeGen/AMDGPU/GlobalISel/fshr.ll
+3,598-1,588llvm/test/CodeGen/AMDGPU/llvm.log.ll
+3,598-1,588llvm/test/CodeGen/AMDGPU/llvm.log10.ll
+2,760-1,251llvm/test/CodeGen/AMDGPU/llvm.log2.ll
+1,894-2,067llvm/test/CodeGen/AMDGPU/div_i128.ll
+17,954-11,023995 files not shown
+58,868-36,7361,001 files

LLVM/project 7e524a8llvm/include/llvm/IR RuntimeLibcalls.td, llvm/lib/Target/MSP430 MSP430Subtarget.cpp

MSP430: Mark more generic libgcc functions as available

The generic soft-float, conversion, comparison and integer helper routines
(__addsf3, __divli's __divsi3, __ashlsi3, ...) exist in the MSP430 libgcc
port alongside the preferred __mspabi_* variants. They were previously removed
to force selection of the __mspabi_* names, back when only one implementation
per libcall could be recorded.

Stop hiding them: only __lshrsi3 stays excluded, since the MSP430 libgcc port
provides the 32-bit logical right shift solely under __mspabi_srll and never
defines a generic __lshrsi3.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+67-0llvm/lib/Target/MSP430/MSP430Subtarget.cpp
+4-11llvm/include/llvm/IR/RuntimeLibcalls.td
+71-112 files

LLVM/project 85a6767clang/include/clang/Basic DiagnosticFrontendKinds.td Attr.td, clang/lib/CodeGen CodeGenModule.cpp CodeGenModule.h

[Clang][AIX] Move -mloadtime-comment-vars validation to Sema. Add Release notes.
DeltaFile
+7-116clang/lib/CodeGen/CodeGenModule.cpp
+75-0clang/lib/Sema/SemaDecl.cpp
+0-40clang/lib/CodeGen/CodeGenModule.h
+0-17clang/include/clang/Basic/DiagnosticFrontendKinds.td
+11-2clang/test/CodeGen/PowerPC/loadtime-comment-vars-cxx.cpp
+10-0clang/include/clang/Basic/Attr.td
+103-1757 files not shown
+126-18213 files

LLVM/project 53bd1e0clang/docs LanguageExtensions.md, clang/lib/CodeGen CodeGenModule.cpp CodeGenModule.h

[Clang][AIX] Switch -mloadtime-comment-vars name matching to mangled IR names

Replace source-qualified name matching in matchesLoadTimeCommentVarName with
mangled IR symbol name matching via getMangledName(GlobalDecl(VD)).
DeltaFile
+13-40clang/lib/CodeGen/CodeGenModule.cpp
+30-22clang/test/CodeGen/loadtime-comment-vars-cxx.cpp
+24-9clang/docs/LanguageExtensions.md
+5-6clang/lib/CodeGen/CodeGenModule.h
+2-4clang/test/Driver/mloadtime-comment-vars.c
+74-815 files

LLVM/project 4785a97clang/lib/CodeGen CodeGenModule.cpp

nit: CodeGenModule.cpp new line deletion
DeltaFile
+0-1clang/lib/CodeGen/CodeGenModule.cpp
+0-11 files

LLVM/project 73c98a2clang/docs LanguageExtensions.md, clang/lib/CodeGen CodeGenModule.cpp

[Clang][AIX] Diagnose unsupported -mloadtime-comment-vars variables
DeltaFile
+228-0clang/test/CodeGen/PowerPC/loadtime-comment-vars-cxx.cpp
+89-34clang/lib/CodeGen/CodeGenModule.cpp
+0-93clang/test/CodeGen/loadtime-comment-vars-cxx.cpp
+0-61clang/test/CodeGen/loadtime-comment-vars.c
+33-28clang/docs/LanguageExtensions.md
+60-0clang/test/CodeGen/PowerPC/loadtime-comment-vars.c
+410-2165 files not shown
+468-22711 files

LLVM/project cb4c208clang/docs LanguageExtensions.md

Apply suggestions from code review

Co-authored-by: Hubert Tong <hubert.reinterpretcast at gmail.com>
DeltaFile
+2-8clang/docs/LanguageExtensions.md
+2-81 files

LLVM/project 88a17f5clang/docs LanguageExtensions.md, clang/lib/CodeGen CodeGenModule.cpp CodeGenModule.h

[Clang][AIX] Handle -mloadtime-comment-vars in global var emission
DeltaFile
+65-93clang/lib/CodeGen/CodeGenModule.cpp
+85-0clang/test/CodeGen/loadtime-comment-vars-cxx.cpp
+15-2clang/docs/LanguageExtensions.md
+6-9clang/lib/CodeGen/CodeGenModule.h
+5-5clang/test/CodeGen/loadtime-comment-vars.c
+4-0clang/test/Driver/mloadtime-comment-vars.c
+180-1096 files

LLVM/project 4686b46clang/docs LanguageExtensions.md, clang/lib/CodeGen CodeGenModule.cpp CodeGenModule.h

[Clang][AIX] Add -mloadtime-comment-vars support to preserve variables in the final object file.
DeltaFile
+119-0clang/lib/CodeGen/CodeGenModule.cpp
+65-0clang/docs/LanguageExtensions.md
+61-0clang/test/CodeGen/loadtime-comment-vars.c
+13-8llvm/test/Transforms/LowerCommentString/lower-comment-string.ll
+18-0clang/lib/CodeGen/CodeGenModule.h
+12-0clang/test/CodeGen/PowerPC/loadtime-comment-mixed.c
+288-84 files not shown
+318-810 files

LLVM/project d02bce1clang/test/CodeGen/PowerPC loadtime-comment-vars-cxx.cpp

Add list-parsing test cases for -mloadtime-comment-vars
DeltaFile
+33-0clang/test/CodeGen/PowerPC/loadtime-comment-vars-cxx.cpp
+33-01 files

LLVM/project 9a85c26llvm/include/llvm/IR RuntimeLibcalls.td, llvm/lib/Target/ARM ARMSubtarget.cpp

ARM: Mark more generic libgcc functions as available

Generic libgcc/compiler-rt functions coexist with aeabi variants
(e.g., __divsi3  and __aeabi_idiv) according to my reading of the
build. At least in compiler-rt, they are aliases (such that I'm not sure
what the point of ever emitting the __aeabi name is).

They were previously removed from the available set on AEABI+AAPCS targets
to force selection of the preferred __aeabi_* variants, back when
only one implementation per libcall could be recorded.

Now that multiple implementations can be available per libcall, stop hiding
the generics and select the __aeabi_* variant explicitly as the preferred
implemntation. This reduces the number of special cases to consider for
future libcalls info improvements.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+64-0llvm/lib/Target/ARM/ARMSubtarget.cpp
+1-6llvm/include/llvm/IR/RuntimeLibcalls.td
+65-62 files

LLVM/project f2153eellvm/lib/TargetParser XtensaTargetParser.cpp

[Xtensa][NFC] Use compact enum for CPUNames/features (#206954)

Store strings without relocations using compact enums. This reduces the
size of libLLVM.so .data.rel.ro by ~1kiB.
DeltaFile
+23-29llvm/lib/TargetParser/XtensaTargetParser.cpp
+23-291 files