[ORC] Replace bindCallControllerHandlerSPS with HandlerSpec (#241133)
Give each existing call-controller handler a descriptor (its default tag
name and SPS signature) and bind it with
bindCallControllerHandler<sps::HandlerSpec<...>>, then remove
bindCallControllerHandlerSPS, which no longer has any users.
Each platform's handler descriptors live in a <platform>_sps_handlers
namespace alongside the platform's existing controller-interface
descriptors. The descriptors for LazyReexportsManager's and
ReOptimizeLayer's handlers follow the same naming scheme.
bindCallControllerHandlerSPS has not appeared in a release, so no
released API is removed.
[ProfileData] Prefer definitions over declarations in InstrProfSymtab (#240698)
When a function declaration and a definition in a module share a
canonical name or GUID (such as promoted ThinLTO symbols or CFI
jump-table declarations alongside `.cfi` bodies), `InstrProfSymtab`
resolved the GUID to whichever appeared first in module order,
preventing indirect call promotion from inlining the definition when the
declaration appeared earlier.
PR Stack:
* ➤ https://github.com/llvm/llvm-project/pull/240698
* https://github.com/llvm/llvm-project/pull/240955
* https://github.com/llvm/llvm-project/pull/240699
Co-authored-by: Benedict Schlüter <bschlueter at google.com>
Assisted-by: Gemini
StackProtector: Take libcall signatures from RuntimeLibcallsInfo
Stop constructing the types by hand, which also missed setting the
calling convention.
This also maintains the special case setting of dso_local, which I
also think should be automatically applied but this requires
additional work.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Declare __stack_smash_handler with only the function name
OpenBSD's libc defines __stack_smash_handler(const char func[], int
damaged) but never reads damaged, and GCC declares and calls it with
only the first argument. Match the compiler's convention instead of
the C prototype, which would require a dead argument at every call
site.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[SPIR-V] Fix G_PTR_ADD selection for addrspacecast global initializers (#238253)
A constant `GEP` of an `addrspacecast` in a global initializer reaches
instruction selection as `G_ADDRSPACE_CAST` followed by `G_PTR_ADD`.
And the `G_PTR_ADD` selector asserted that its base was a global, so
`llc` aborted.
So, select the access chain from the cast result. The `G_PTR_ADD` offset
is a byte count, so it is used as the Element operand over an `i8`
pointer casted from a typed base.
[AMDGPU][GISel] Use the function stack pointer in legalizeStackSave (#240815)
Currently, `legalizeStackSave` reads the concrete stack pointer
`$sgpr32`, but entry functions do not reserve that register until
`finalizeLowering`.
So, the machine verifier reported an undefined `$sgpr32` on
`G_AMDGPU_WAVE_ADDRESS` in `kernel_store_stacksave`.
Use the reserved `$sp_reg` placeholder instead, until `finalizeLowering`
rewrites it.
RuntimeLibcalls: Add missing attributes to memory and allocator libcalls
Add the attributes inferLibFuncAttributes would give these functions.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>