LLVM/project 2f2aa94lldb/source/Plugins/LanguageRuntime/CPlusPlus ItaniumABIRuntime.cpp, lldb/source/Plugins/SymbolFile/DWARF SymbolFileDWARF.cpp

[lldb] Fallback to `__clang_vtable` for robust dynamic type resolution (#210584)

`ItaniumABIRuntime::GetTypeInfo(...)`'s type resolution relies on the
demangler to locate the type corresponding to a vtable address. As
reported in #182762 this can break when the demangler and debug info
don't agree on the spelling of the type's name.

This PR implements an lookup based on a support member emitted by clang
added in #130255 as `_vtable$`, later renamed to `__clang_vtable` in
#183617. If the demangling based approach fails we fall back to the new
route.

The initial implementation aims to only support the modern spelling with
DWARF.
DeltaFile
+90-2lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABIRuntime.cpp
+38-0lldb/test/API/lang/cpp/dynamic-value-complex-typename/TestDynamicValueComplexTypename.py
+38-0lldb/test/API/lang/cpp/dynamic-value-virtual-inheritance/TestDynamicValueVirtualInheritance.py
+36-0lldb/test/API/lang/cpp/dynamic-value-virtual-inheritance/main.cpp
+34-0lldb/test/API/lang/cpp/dynamic-value-complex-typename/main.cpp
+16-0lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+252-210 files not shown
+301-216 files

LLVM/project 2e5620ellvm/lib/CodeGen/SelectionDAG LegalizeFloatTypes.cpp, llvm/test/CodeGen/SystemZ soft-float-05.ll

[SelectionDAG] powi and ldexp libcalls deal with signed int arguments (#213673)

While investigating a sign extension problem on an off-tree target that
needs extension of 32-bit integer argument to 64-bit register when
passed as an argument, I found that `__powisf2` was being passed
zero-extended despite the argument being a signed `int`. I narrowed this
down to the fact that `shouldSignExtendTypeInLibCall` was being passed
`false` for `IsSigned` for the `int` argument in these libcalls.

Other libcalls (not an exhaustive review) such as the `XINT_TO_FP`
family do set the `IsSigned` value here.

I utilized the s390x target to write a test for this.
DeltaFile
+48-0llvm/test/CodeGen/SystemZ/soft-float-05.ll
+1-0llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+49-02 files

LLVM/project 1f4fbe8llvm/lib/Target/RISCV RISCVVectorPeephole.cpp RISCVInstrInfoZvzip.td, llvm/test/CodeGen/RISCV/rvv vmerge-peephole.mir vpaire.ll

[RISCV] Teach the VL Optimizer about Zvzip instructions (#214405)

Set ElementsDependOn = EltDepsNone on the five Zvzip instructions
(VZIP_VV, VUNZIPE_V, VUNZIPO_V, VPAIRE_VV, VPAIRO_VV) so the pass no
longer conservatively treats their result elements as depending on VL
and Mask (beyond masking of inactive lanes).

Wire the opcodes into the VL Optimizer's operand model:

 - getOperandLog2EEW: all five instructions return MILog2SEW (source
   and destination EEW both equal SEW).

 - getOperandInfo: for VZIP_VV, widen the destination and passthru
   EMUL by 2x since it interleaves two LMUL inputs into one 2xLMUL
   result. For VUNZIPE_V / VUNZIPO_V, widen the EMUL of the vs2
   source operand by 2x instead, as the split consumes a 2xLMUL
   vector and produces an LMUL even/odd half. VPAIRE_VV / VPAIRO_VV
   leave EMUL unchanged on every operand.

Assisted-by: TRAE CLI (Seed-2.1-Turbo)
DeltaFile
+186-1llvm/test/CodeGen/RISCV/rvv/vl-opt-op-info.mir
+54-4llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp
+32-24llvm/test/CodeGen/RISCV/rvv/vpaire.ll
+19-2llvm/test/CodeGen/RISCV/rvv/vmerge-peephole.mir
+5-3llvm/lib/Target/RISCV/RISCVInstrInfoZvzip.td
+4-2llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp
+300-366 files

LLVM/project 3cf119allvm/lib/ExecutionEngine/Orc SelfExecutorProcessControl.cpp, llvm/lib/ExecutionEngine/Orc/TargetProcess OrcRTBootstrap.h OrcRTBootstrap.cpp

[ORC] Register SPS run-as function wrappers with SelfEPC (#220224)

#213265 replaced the direct `ExecutorProcessControl::runAsVoidFunction`
and `runAsIntFunction` calls in `COFFPlatform` and
`COFFVCRuntimeSupport` with SPS call proxies. The target-process
bootstrap registers the corresponding executor-side wrappers for
`SimpleRemoteEPC`, but SelfEPC does not register them. In-process
clients using these paths therefore fail to resolve:

```text
orc_rt_ci_sps_call_int32_void
orc_rt_ci_sps_call_int32_int32
```

This patch factors registration of the two existing run-as function
wrappers out of the complete target-process bootstrap set and adds that
narrow set to SelfEPC.

SelfEPC already provides in-process memory access directly, so it does

    [14 lines not shown]
DeltaFile
+29-0llvm/unittests/ExecutionEngine/Orc/SPSProxySpecTest.cpp
+8-4llvm/lib/ExecutionEngine/Orc/TargetProcess/OrcRTBootstrap.cpp
+4-0llvm/lib/ExecutionEngine/Orc/TargetProcess/OrcRTBootstrap.h
+3-0llvm/lib/ExecutionEngine/Orc/SelfExecutorProcessControl.cpp
+44-44 files

LLVM/project 9c79a77llvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV/rvv vabd.ll

[RISCV] Fix result type checks in the VWABDA DAG combine (#220497)

Fix the result element type check in `performVWABDACombine`. The result
of the widening add operation has already been widened, so the expected
element types are `i16` and `i32`, rather than `i8` and `i16`. The
previous check prevented the i16-i32 form from being combined.
DeltaFile
+34-0llvm/test/CodeGen/RISCV/rvv/vabd.ll
+2-2llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+36-22 files

LLVM/project 3accf66clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR][NFC] Generate getSuccessorRegions for fixed-region ops

Six of the ten CIR ops implementing RegionBranchOpInterface reported a fixed
list of entry regions and the parent operation on every region exit, which
makes the whole method derivable from the region accessor names. Extend
CIR_RegionBranchOpBase with an entryRegions parameter that generates it and
delete the six hand-written definitions.

IfOp, GlobalOp, TryOp and AwaitOp keep theirs, since their entry edges are not
a fixed list: IfOp falls back to the parent when the else region is empty,
GlobalOp skips its optional ctor and dtor regions, TryOp iterates variadic
handler regions, and AwaitOp routes ready to resume and suspend.

The generated CIROps.h.inc is unchanged and CIROps.cpp.inc gains exactly the
six definitions removed from CIRDialect.cpp.
DeltaFile
+0-67clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+33-14clang/include/clang/CIR/Dialect/IR/CIROps.td
+33-812 files

LLVM/project 8efad88clang/include/clang/Basic AArch64CodeGenUtils.h, clang/lib/CIR/CodeGen CIRGenBuiltinAArch64.cpp

[clang][CIR][AArch64] Add lowering for SISD variants of rounding intrinsics (#219241)

This PR adds lowering for the remaining SISD "Vector saturating rounding
shift right and narrow " intrinsic:
* https://arm-software.github.io/acle/neon_intrinsics/advsimd.html#vector-saturating-rounding-shift-right-and-narrow

The following builtins are added:
 * __builtin_neon_vqrshrns_n_s32:
 * __builtin_neon_vqrshrns_n_u32:
 * __builtin_neon_vqrshrnh_n_s16:
 * __builtin_neon_vqrshrnh_n_u16:
 * __builtin_neon_vqrshruns_n_s32:
 * __builtin_neon_vqrshrunh_n_s16:

The corresponding tests are moved from:
  * clang/test/CodeGen/AArch64/

to:
  * clang/test/CodeGen/AArch64/neon/

    [2 lines not shown]
DeltaFile
+73-1clang/test/CodeGen/AArch64/neon/intrinsics.c
+0-70clang/test/CodeGen/AArch64/neon-intrinsics.c
+6-6clang/include/clang/Basic/AArch64CodeGenUtils.h
+6-0clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
+85-774 files

LLVM/project f343a76llvm/lib/Transforms/IPO MergeFunctions.cpp, llvm/lib/Transforms/Utils FunctionComparator.cpp

[MergeFunctions] Intersect poison-generating flags (#220015)

Instead of comparing the flags in FunctionComparator, intersect them in
MergeFunctions. This both a) fixes miscompiles where we failed to check
the poison flags for GEP and FMF and b) allows more function merging, in
cases where the functions only differ in flags.

This can be extended to combine instruction-level metadata as well in
the future.

Fixes https://github.com/llvm/llvm-project/issues/219664.
DeltaFile
+86-0llvm/test/Transforms/MergeFunc/flags.ll
+23-22llvm/lib/Transforms/IPO/MergeFunctions.cpp
+0-8llvm/lib/Transforms/Utils/FunctionComparator.cpp
+109-303 files

LLVM/project 19559bdutils/bazel/llvm-project-overlay/libc platforms.bzl BUILD.bazel

[Bazel] Add missing includes for riscv64 (#219483)
DeltaFile
+3-1utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+2-0utils/bazel/llvm-project-overlay/libc/platforms.bzl
+5-12 files

LLVM/project 2033899clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

[CIR][NFC] Share getSuccessorInputs across region-branch ops

The ten CIR ops implementing RegionBranchOpInterface each hand-wrote
getSuccessorInputs, and all ten bodies were equivalent: regions take no
inputs, and returning to the parent yields the parent's results. Three did
not look equivalent but are: CleanupScopeOp and CoroBodyOp returned an empty
ValueRange unconditionally and declare no results, and AwaitOp returned
region block arguments but carries NoRegionArguments, so those ranges are
always empty.

Add a CIR_RegionBranchOpBase ODS class that declares the method and generates
the single shared body through extraClassDefinition, mirroring the existing
CIR_LoopOpBase, and retarget all ten ops onto it.

The generated CIROps.h.inc is unchanged and CIROps.cpp.inc gains exactly the
ten definitions removed from CIRDialect.cpp.
DeltaFile
+0-57clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+31-20clang/include/clang/CIR/Dialect/IR/CIROps.td
+31-772 files

LLVM/project 01e2d19llvm/lib/Target/AArch64 AArch64ISelLowering.cpp, llvm/test/CodeGen/AArch64 sve-vector-repeat.ll

Support nxv1 types
DeltaFile
+94-0llvm/test/CodeGen/AArch64/sve-vector-repeat.ll
+17-0llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+111-02 files

LLVM/project 7c3201ellvm/include/llvm/Transforms/Vectorize/SandboxVectorizer VecUtils.h, llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes BundleVec.cpp

[SandboxVec][NFC] Hoist getInsertPointAfterInstrs into VecUtils (#215863)

Move BottomUpVec.cpp's file-local getInsertPointAfterInstrs() into
VecUtils. NFC.

Co-authored-by: Claude Opus 5 <noreply at anthropic.com>
DeltaFile
+87-0llvm/unittests/Transforms/Vectorize/SandboxVectorizer/VecUtilsTest.cpp
+6-18llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BundleVec.cpp
+14-0llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h
+107-183 files

LLVM/project 2495d82orc-rt/include/orc-rt-c/support Compiler.h, orc-rt/include/orc-rt-internal/support/sys CacheControl.h

[orc-rt] Add ORC_RT_HAS_BUILTIN, stop defining __has_builtin (#220503)

orc-rt/support/Compiler.h supplied a fallback definition of
__has_builtin for compilers that lack it. __has_builtin is a reserved
identifier, and defining one from a public header can collide with the
compiler's own definition or with another library the client includes.

Replace it with ORC_RT_HAS_BUILTIN(X) in orc-rt-c/support/Compiler.h,
which wraps __has_builtin where it exists and expands to 0 otherwise,
and convert the five uses.
DeltaFile
+13-0orc-rt/include/orc-rt-c/support/Compiler.h
+2-6orc-rt/include/orc-rt/support/Compiler.h
+4-2orc-rt/include/orc-rt/support/bit.h
+1-1orc-rt/include/orc-rt-internal/support/sys/CacheControl.h
+20-94 files

LLVM/project 058c728clang/lib/Sema SemaCUDA.cpp, clang/test/SemaHIP hip-incremental-toplevel-launch.hip

[clang][Sema] Allow null caller for HIP kernel launch in incremental mode (#218659)

This PR allows a HIP kernel to be launched without a caller in
incremental mode. This is necessary because in incremental
mode(clang-repl), there isn't a `main` or any function that calls the
kernel.

Also adds a Sema test that compiles a top-level HIP kernel launch in
incremental device mode and verifies it is accepted.

Assisted by Claude Opus 4.8
DeltaFile
+29-0clang/test/SemaHIP/hip-incremental-toplevel-launch.hip
+5-3clang/lib/Sema/SemaCUDA.cpp
+34-32 files

LLVM/project fee2e96clang/lib/CIR/Dialect/IR CIRDialect.cpp, clang/unittests/CIR ControlFlowTest.cpp

[CIR] Add RegionBranchOpInterface unit tests and fix cir.await successors

Five of the ten ops implementing RegionBranchOpInterface have no unit test
coverage: cir.case, cir.cleanup.scope, cir.global, cir.await and
cir.coro.body. Add tests for all five.

Covering cir.await exposes a disagreement with its own terminator.
cir.condition terminates the ready region and reports {resume, suspend} as
its successors when the parent is an await, but AwaitOp::getSuccessorRegions
listed all three regions as entry successors and reported the parent op as
the successor of every region exit. Fix it to match cir.condition: ready is
the only entry successor, exiting ready branches to resume or suspend, and
exiting suspend or resume returns to the parent operation.

cir.await declares no results and carries NoRegionArguments, so successor
operand and input counts stay at zero along every edge and the MLIR verifier
is unaffected.
DeltaFile
+155-0clang/unittests/CIR/ControlFlowTest.cpp
+20-7clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+175-72 files

LLVM/project dcf6f15mlir/lib/Dialect/SCF/Transforms StructuralTypeConversions.cpp, mlir/test/Transforms test-legalize-type-conversion.mlir

[mlir][SCF] Handle dropped operands in structural type conversion (#220473)

SCF structural type conversion assumes that `scf.for` bounds and
`scf.if` conditions are converted to exactly one value. A 1:N conversion
can drop or split these operands, causing `getSingleElement` to trigger
an assertion.

Reject conversions with non-single-valued bounds or conditions and add
regression coverage.

Fixes: https://github.com/llvm/llvm-project/issues/220459
DeltaFile
+27-0mlir/test/Transforms/test-legalize-type-conversion.mlir
+10-0mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp
+9-0mlir/test/lib/Dialect/Test/TestPatterns.cpp
+46-03 files

LLVM/project 529c4daclang/include/clang/Basic DiagnosticFrontendKinds.td CodeGenOptions.def, clang/lib/CodeGen CGException.cpp CodeGenModule.cpp

clang: Distinguish unspecified from disabled exception model

Add ExceptionHandlingKind::Default so clang can tell an unspecified
exception model from an explicit -exception-model=none.
DeltaFile
+18-17clang/test/CodeGen/exception-model-flag.c
+10-1clang/include/clang/Basic/CodeGenOptions.h
+5-4clang/lib/CodeGen/CodeGenModule.cpp
+4-2clang/lib/CodeGen/CGException.cpp
+1-1clang/include/clang/Basic/DiagnosticFrontendKinds.td
+1-1clang/include/clang/Basic/CodeGenOptions.def
+39-266 files not shown
+45-3212 files

LLVM/project b79523cclang/include/clang/Basic CodeGenOptions.h, clang/lib/CodeGen CodeGenModule.cpp

clang: Emit "exception-model" module flag

Record the exception-handling model as an "exception-model" IR module
flag when it differs from the target triple's default, mirroring how
other target ABI properties are recorded. Adds a
CodeGenOptions::toExceptionHandling helper to translate clang's
ExceptionHandlingKind into the LLVM ExceptionHandling enum.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+38-0clang/test/CodeGen/exception-model-flag.c
+19-0clang/include/clang/Basic/CodeGenOptions.h
+12-0clang/lib/CodeGen/CodeGenModule.cpp
+69-03 files

LLVM/project ec8fcfbllvm/docs LangRef.md, llvm/include/llvm/Support CodeGen.h

Distinguish unspecified from disabled exception model
DeltaFile
+9-4llvm/include/llvm/Support/CodeGen.h
+8-3llvm/docs/LangRef.md
+3-5llvm/lib/IR/RuntimeLibcalls.cpp
+4-4llvm/lib/IR/Module.cpp
+3-4llvm/include/llvm/Target/TargetMachine.h
+6-0llvm/test/Assembler/module-flags-exception-model.ll
+33-207 files not shown
+45-2613 files

LLVM/project 4fc1df3llvm/docs LangRef.md, llvm/include/llvm/Support CodeGen.h

IR: Introduce "exception-model" module flag

Add an "exception-model" IR module flag intended to replace
TargetOptions::ExceptionModel, such that the ABI is fully
computable from the IR alone. Add the basic documentation and
verifier/linker tests, but doesn't wire up the consumers.

The main thing I question is whether the single "wasm" model is
really the correct control. With the existing TargetOption,
WebAssembly is overloading "none" in a weird way that sometimes
means default, and sometimes mean forcibly disabled exceptions.
It additionally has -wasm-enable-eh and -wasm-enable-sjlj cl::opts
and I don't fully understand the interaction between all of these
knobs; the cl::opts are even worse than the TargetOptions since
these still change the ABI and are backend private.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+40-0llvm/include/llvm/Support/CodeGen.h
+37-0llvm/test/Verifier/module-flags-exception-model.ll
+35-0llvm/docs/LangRef.md
+31-0llvm/test/Assembler/module-flags-exception-model.ll
+28-0llvm/test/Linker/module-flags-exception-model.ll
+9-3llvm/lib/IR/Verifier.cpp
+180-32 files not shown
+199-38 files

LLVM/project fdd8991clang/lib/AST/ByteCode InterpFrame.cpp State.h

[clang][bytecode] Clean up includes around Frame/State (#220278)
DeltaFile
+4-1clang/lib/AST/ByteCode/Frame.h
+1-2clang/lib/AST/ByteCode/State.cpp
+0-2clang/lib/AST/ByteCode/State.h
+0-1clang/lib/AST/ByteCode/InterpFrame.cpp
+5-64 files

LLVM/project baaa72fllvm/lib/Transforms/IPO GlobalOpt.cpp, llvm/test/Transforms/GlobalOpt self-referential-global.ll

[GlobalOpt] Fix crash on self-referential global (#219777)

Fix crash in `GlobalOpt` when a global references itself (void *g = &g).
Collect users into a vector to avoid iterator invalidation.

Fixes: #219629
DeltaFile
+24-0llvm/test/Transforms/GlobalOpt/self-referential-global.ll
+5-12llvm/lib/Transforms/IPO/GlobalOpt.cpp
+29-122 files

LLVM/project 57be70dllvm/lib/Target/AMDGPU AMDGPULowerIntrinsics.cpp, llvm/lib/Target/AMDGPU/AsmParser AMDGPUAsmParser.cpp

[AMDGPU] Validate barrier ID in S_BARRIER_SIGNAL_ISFIRST

Value user_cluster_barrier_id is not supported.
DeltaFile
+3-36llvm/test/CodeGen/AMDGPU/lower-intrinsics-cluster-barrier.ll
+23-0llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+9-0llvm/test/CodeGen/AMDGPU/llvm.amdgcn.s.barrier.signal.isfirst.invalid_barrier.ll
+5-0llvm/lib/Target/AMDGPU/AMDGPULowerIntrinsics.cpp
+5-0llvm/test/MC/AMDGPU/gfx13_err.s
+3-0llvm/test/MC/AMDGPU/gfx12_err.s
+48-361 files not shown
+49-367 files

LLVM/project 0d9ffe5llvm/test/MC/AMDGPU gfx12_err.s

[AMDGPU] Regenerate gfx12_err.s. NFC

Wrong tool was recorded in the test header.
DeltaFile
+221-222llvm/test/MC/AMDGPU/gfx12_err.s
+221-2221 files

LLVM/project cf2b661orc-rt/include/orc-rt-c/support Compiler.h Error.h, orc-rt/include/orc-rt/support Compiler.h

[orc-rt] Consolidate symbol export macros (#220495)

Replace the overlapping visibility macros with a single pair, one per
public API surface:

  ORC_RT_C_EXPORT (orc-rt-c/support/Compiler.h) - the C API
  ORC_RT_EXPORT   (orc-rt/support/Compiler.h)   - the C++ API

ORC_RT_C_ABI is renamed to ORC_RT_C_EXPORT. ORC_RT_INTERFACE,
ORC_RT_HIDDEN and ORC_RT_IMPORT are removed.

ORC_RT_EXPORT is currently defined as ORC_RT_C_EXPORT so that the
platform logic lives in one place. It becomes separately switchable once
there is an option to hide the C++ API.

No change to generated code: every macro expands to exactly what it did
before. The Windows dllexport/dllimport and static-build cases are left
as a TODO for the commit that adds the shared-library build.
DeltaFile
+11-9orc-rt/include/orc-rt/support/Compiler.h
+10-7orc-rt/include/orc-rt-c/support/Error.h
+9-5orc-rt/include/orc-rt-c/support/Compiler.h
+8-3orc-rt/lib/bedrock/GDBJITRegistrar.cpp
+38-244 files

LLVM/project 1d1fe29clang/lib/AST/ByteCode InterpFrame.cpp

[clang][bytecode][NFC] assert(Func) in InterpFrame ctor (#220284)

`Func` is only null for the bottom frame, which we create using another
constructor.
DeltaFile
+1-3clang/lib/AST/ByteCode/InterpFrame.cpp
+1-31 files

LLVM/project df357e7llvm/test/CodeGen/Mips cttz-v.ll, llvm/test/CodeGen/RISCV rv64xtheadbb.ll ctlz-cttz-ctpop.ll

[SelectionDAG] Use ctlz(x & -x) ^ 31 for CTTZ_ZERO_POISON when ctpop is not available (#220415)

Update Mips, PowerPC, RISCV, SPARC, SystemZ, and X86 tests to reflect
the more efficient sequence.
DeltaFile
+49-81llvm/test/CodeGen/RISCV/ctlz-cttz-ctpop.ll
+30-32llvm/test/CodeGen/Mips/cttz-v.ll
+26-32llvm/test/CodeGen/SPARC/cttz.ll
+16-25llvm/test/CodeGen/RISCV/rv64xtheadbb.ll
+18-20llvm/test/CodeGen/X86/vector-tzcnt-256.ll
+17-20llvm/test/CodeGen/X86/vector-tzcnt-128.ll
+156-2106 files not shown
+230-27512 files

LLVM/project 810c9cborc-rt/test/unit/bedrock/sps SimpleRemoteCATest.cpp

[orc-rt] Fix field initialization order warning in unit test. (#220493)
DeltaFile
+3-3orc-rt/test/unit/bedrock/sps/SimpleRemoteCATest.cpp
+3-31 files

LLVM/project 65e2a60llvm/lib/IR IRBuilder.cpp, llvm/test/CodeGen/AMDGPU promote-alloca-byte-ptr-cast.ll

[IRBuilder] Handle byte types in CreateBitPreservingCastChain (#209557)

`CreateBitPreservingCastChain` only routed conversions through an
`inttoptr`/`ptrtoint` step when the non-pointer side was an integer or
integer vector. Byte and byte-vector types are not integer types, so a
byte/byte-vector to pointer conversion fell through to a plain bitcast,
producing an invalid bitcast between a non-pointer aggregate and a
pointer (e.g. `bitcast <2 x b32> to ptr`). This manifested as a
MachineVerifier "bitcast cannot convert between pointers and other
types" failure once a pass fed byte element types into the cast chain.

This patch treats byte and byte-vector types the same as integers here
so the conversion goes through a pointer-sized integer.

Co-authored-by: Cursor <cursoragent at cursor.com>
DeltaFile
+49-0llvm/test/CodeGen/AMDGPU/promote-alloca-byte-ptr-cast.ll
+18-0llvm/unittests/IR/IRBuilderTest.cpp
+6-2llvm/lib/IR/IRBuilder.cpp
+73-23 files

LLVM/project 1e17522llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer VecUtils.h, llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes BundleVec.cpp

[SandboxVectorizer] Hoist getInsertPointAfterInstrs into VecUtils

Move BottomUpVec.cpp's file-local getInsertPointAfterInstrs() into
VecUtils, next to the getLowest()/getLastPHIOrSelf() primitives it's
built from. It has no BottomUpVec-specific state; the next commit adds a
second caller in LoadStoreVec.

Not hoisting BottomUpVec::createPack() itself here: it asserts a single
common scalar type (VecUtils::getCommonScalarType), which doesn't fit
LoadStoreVec's mixed-type ("enable-diff-types") requirement. That needs
its own extended packer, kept local to LoadStoreVec.cpp rather than
force-fitting the shared version.

No functional change: check-llvm Transforms/SandboxVectorizer passes
(28/28).

Co-Authored-By: Claude Opus 5 <noreply at anthropic.com>
DeltaFile
+87-0llvm/unittests/Transforms/Vectorize/SandboxVectorizer/VecUtilsTest.cpp
+6-18llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/BundleVec.cpp
+14-0llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h
+107-183 files