[AMDGPU][GISel] Fix stack pointer shift direction in selectStackRestore (#240831)
`llvm.stacksave` returns `SP >> log2(wavesize)`. Restoring a value that
is not the direct result of `G_AMDGPU_WAVE_ADDRESS` has to shift that
value back left before copying it to the stack pointer.
However, `selectStackRestore` uses `S_LSHR_B32` on that path. Change it
to `S_LSHL_B32` instead.
[RISCV][P-ext] Make v2i32 insert_vector_elt with constant indices legal for RV32.
We can select to an insert_subreg.
The default lowering created a store+load to stack that got folded,
but left behind the stack slot allocation.
Assisted-by: Claude
[SPIR-V] Lower G_SMULFIXSAT and G_UMULFIXSAT (#241155)
Reuse the G_SMULFIX rule, including the s64 gate
Also lower G_TRUNC_SSAT_S and G_TRUNC_USAT_U, which the generic mulfix
lowering emits
[CIR] Fix va_list lowering for non-zero default address space (#238455)
Drop the bitcast to a generic-AS `ptr`, which is invalid for `ptr
addrspace(4)` on SPIR-V
[mlir][XeGPU] Preserve consumer instruction blocking for vector.multi_reduction (#240592)
vector.multi_reduction previously reset inst_data to lane_layout *
lane_data, losing larger instruction blocks requested by its consumer.
Preserve compatible consumer blocking on non-reduced dimensions when
reusing a matching slice parent.
Also improve the documentation and simplify the code logic regarding
lane assignment and vector packing, and add tests for blocking
preservation and clamping reused lanes to the source extent.
assisted-by-ai
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>
[RISCV][P-ext] Lower 2 element insert_vector_elt to scalar_to_vec+ppaire/ppaireo.
This avoids needing to match the srl+build_vec later which we only
do on RV64.
[RuntimeLibcalls] Take the module in libcall signature converters (NFC)
The converters that turn declaration C type descriptions into IR types
and attributes take a context, a triple and a data layout. A libcall
declaration can also depend on properties recorded in the module itself
rather than in the triple, so pass the module instead and derive all
three from it.
Change getDefaultFunctionTy, getFunctionTy, getVariableType and the
static helpers they use to take a Module, and update the callers. No
functional change intended.
Assisted-by: Claude
[clang][deps] Give `LocalFS` precedence in the scanning VFS overlay (#241464)
The overlay of `LocalFS` and the global FS that
`DependencyScanningWorkerFilesystem`
forwards unhandled queries to (e.g. directory iteration) put the global
FS on
top. That's inconsistent with `status()`, `openFileForRead()` and
`getRealPath()`,
which look at `LocalFS` first. Put `LocalFS` on top of the overlay
instead.
Depends on #241463, only review the second commit.
[CIR][OpenMP] Add registerTargetGlobalVariable for global variables (#234077)
Limit the NYI to declare target variables so other globals emit under
-fopenmp
[CIR] Keep source address space in vtable.get_vptr result (#238495)
The result was always in the default address space, so objects in other
address spaces left an unrealized_conversion_cast and failed LLVM
translation
RuntimeLibcalls: Add attributes to memcpy, memmove and memset
Annotate memcpy, memmove and memset with the attributes
inferLibFuncAttributes gives them. Also handle the __aeabi variants,
which aren't exactly the same.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Make the AEABI memory functions distinct libcalls
__aeabi_memcpy, __aeabi_memmove and __aeabi_memset were
implementations of MEMCPY, MEMMOVE and MEMSET but did not have the
same signature. These return void instead of returning the destination
argument. Additionally __aeabi_memset takes its size before its
value. Add distinct Libcalls since these are not the same.
ARM relied on MEMCPY resolving to __aeabi_memcpy for the memcpy calls
it did not specialize, such as unaligned and minsize copies. Select
the AEABI functions in ARM lowering for those as well.
To keep these as tail calls, the EmitTargetCode* methods now take an
in/out IsTailCall like CallLoweringInfo. As a side effect this allows
all the targets emitting calls for the specialized code emit tail
calls, including the __aeabi functions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>