[VPlan] Only simplify ExtractLastLane of non-wide single-scalar. (#202234)
After 8e868c5, we may remove ExtractLastLane of a wide recipe that could
be single scalar but has not been narrowed. Limit to
VPInstruction/VPReplicateReceipe to fix crash in added test case.
Fixes https://github.com/llvm/llvm-project/issues/201582.
[NVPTX] pass variadics frame as local pointer (#201661)
Pass the pointer for variadics as a local (addrspace(5)) pointer. This
enables InferAddressSpace to convert loads of vaargs to local loads
(pipeline reordered to accomadate) and will also save a register in
short pointer mode. We leave vaListType as a generic pointer and cast
when expanding va_start to maintain backwards compatibility with IR
written expecting the va_list to be a generic pointer.
[SPIR-V] Rewrite extractvalue over aggregate spv_extractv result (#200065)
Chained extractvalue from an aggregate-returning call left raw IR over a
multi-register spv_extractv, crashing later in foldImm. Mutate the
producer to i32 and convert the user too
[SPIR-V] Lower vector-typed GEPs with more than 1 element in SPIRVEmitIntrinsics (#197101)
Fix spirv-val concern in the IR from #186764 with vector-typed GEPs (`<N
x ptr>`) that were lowered to a single spv_gep intrinsic with a vector
return
```
error: line 54: The Result Type of OpPtrAccessChain <id> '...' must be OpTypePointer. Found OpTypeVector.
```
Resolves #186764
[InstCombine][NFC] Use custom inserter for metadata (#202206)
Proactively getting metadata for every visited instruction is expensive.
Therefore, only store the current instruction and get the metadata only
when an instruction is actually inserted.
[DenseMap] Canonicalize pointer hashes. NFC (#202226)
`(p>>4)^(p>>9)` does not mix the high bits of the address. Pointers from
one allocator grown across multiple slabs whose low-bit windows overlap
map to the same narrow bucket range, an issue fixed by #197390.
Fix by delegating to the canonical pointer hash.
compiler-rt: Suppress -g error for gpu builds
Currently a RelWithDebInfo build fails when gpu targets
are enabled enabled as runtime targets, since clang will error
with -g.
Co-Authored-By: Claude Sonnet 4.5 <noreply at anthropic.com>
[VPlan] Use VPInstructionWithType for uniform casts. (#140623)
Use VPInstructionWithType instead of VPReplicate recipe for uniform
casts. This is a first step towards breaking up VPReplicateRecipe. Using
the general VPInstructionWithType has the additional benefit that we can
now apply a number of simplifications directly.
Depends on https://github.com/llvm/llvm-project/pull/140621
PR: https://github.com/llvm/llvm-project/pull/140623
[clang-tidy] Preserve line endings in macro-to-enum fixes (#202054)
Use `StringRef::detectEOL()` when inserting enum braces so fix-its do
not mix LF into CRLF source files.
Closes https://github.com/llvm/llvm-project/issues/61593
[lld-macho] Replace unordered_{map,set} with Dense{Map,Set} (#202100)
DenseMap no longer uses in-band sentinel keys (#201281) and is superior
to unordered_map in these scenarios.
[LoopInterchange] Reject interchange when AnyOf reduction exists (#202092)
This patch removes `AnyOf` reductions from the legal candidates for
interchange. In some cases, especially when the result value of `AnyOf`
is loop-invariant with respect to outer loop, then the interchange
should be legal. However, at the moment, we reject all the cases
conservatively.
Fixes #202089 .
[LoopInterchange] Add test for loop contains AnyOf reduction (NFC) (#202091)
This patch adds the test case raised in #202089. The issue will be fixed
by a follow-up patch #202092.
[analyzer] Generalize field initializer resolution in RegionStore (#189361)
Replace the ad-hoc blocks in getBindingForField with a single helper
getConstantValFromInitializer that walks up the region chain to a
VarRegion, then walks down the InitListExpr (semantic form) by field
and element indices. Handles arbitrary nesting depth, including
multidimensional arrays of structs and structs containing arrays.
The same trust conditions apply: const-qualified types are always
trusted, and non-const globals are trusted when analyzing main().
For C++ structs with user-defined constructors, we conservatively
fall through to the symbolic path because the constructor body may
establish values that differ from the InitListExpr. Resolving
constructor-initialized values is left to a separate change.
Union initializers are handled by matching the accessed field against
the initialized member, accesses to inactive union members return
unknown.
[6 lines not shown]
[TableGen] Fix crash of !switch parse in defvar context (#202119)
`ListInit::convertInitializerTo()` and similar variants do not perform a
nullptr check. Adding a check to the caller parse method and a test case
for defvar.
[SCEVExpander] Do not insert after callbr (#201322)
findInsertPointAfter handle invoke and otherwise use the instruction
after def instruction as the insertion point.
This is not valid for callbr which is a terminator. Advancing the
iterator moves the insertion point past the terminator, and the
following code uses that invalid position, e.g when asm goto lowers to
callbr in #200987
Use the insertion point before MustDominate for callbr.
Fixes #200987
[CIR][OpenCL] Attach kernel argument metadata to CIR functions
Emit the CIR OpenCL kernel argument metadata attribute for kernel functions. Preserve CIR language address-space kinds until lowering and include argument names only when `-cl-kernel-arg-info` is enabled.