RuntimeLibcalls: Use element alignment for vector libcall out pointers
The pointer arguments of the vector modf, sincos and sincospi functions
are linear pointers to the scalar element type (e.g. the l4 in
_ZGVnN4vl4l4_sincosf), not pointers to the vector type. Only the element
alignment is guaranteed, so stop declaring them with the ABI alignment
of the vector.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Add signatures for more runtime functions
Add type missing signatures for assorted functions which were missing
type information.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Describe vector FuncArgTypes by element type and count
Define the vector libcall argument types from an element type and
count. Derive the matching integer and mask vector types from them
instead of spelling each one out.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Use the correct target C long width for Long
Long and ULong were mapped to the int width, which is wrong on LP64
targets (e.g. scalbln was declared taking i32 on x86_64 linux) and on
16-bit targets where long is 32 bits.
Also fix strtoul, strtoull, and the unsigned long operator new/delete
variants to use the unsigned types.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[clang][OpenMP] Fix crash on `lastprivate` of a data member in a member function template (#237575)
Fixes #144302
`lastprivate(i)` on a data member inside a member function template of a
non-template class crashed in `EndOpenMPDSABlock`. In a dependent
context the clause keeps the member as the `this->i` expression, but the
finalizer cast every non-dependent item to `DeclRefExpr`.
Skip the member there and leave its private copy to be built when the
template is instantiated, where the member gets captured as usual.
LLM Aided.
[RISCV][GISel] Make G_CTLZ legal with XTHeadBb (#237510)
XTHeadBb provides `th.ff1` and matches `G_CTLZ` semantics. The existing
pattern `PatGpr<ctlz, TH_FF1>` is already imported by GlobalISel, but
the legalizer always lowered `G_CTLZ` when Zbb was not available, so
`th.ff1` was never selected.
Part of https://github.com/llvm/llvm-project/issues/237492.
I plan to address the whole problem with 3 patches to control patch size
and ease review process:
1. This commit
2. Use the zero-poison semantics of `G_CTLZ_ZERO_POISON` for narrower
widths.
3. Widen narrow `G_CTTZ` to XLEN before lowering.
[VPlan] Use the interleave group's alignment for narrowed accesses. (#237674)
Use the interleave group's alignment instead of the one from the insert
position, which may not be the alignment for the member at index 0.
This fixes a mis-compile where the wide load had an incorrect alignment.
RuntimeLibcalls: Describe vector FuncArgTypes by element type and count
Define the vector libcall argument types from an element type and
count. Derive the matching integer and mask vector types from them
instead of spelling each one out.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Add signatures for more runtime functions
Add type missing signatures for assorted functions which were missing
type information.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Use element alignment for vector libcall out pointers
The pointer arguments of the vector modf, sincos and sincospi functions
are linear pointers to the scalar element type (e.g. the l4 in
_ZGVnN4vl4l4_sincosf), not pointers to the vector type. Only the element
alignment is guaranteed, so stop declaring them with the ABI alignment
of the vector.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Use the correct target C long width for Long
Long and ULong were mapped to the int width, which is wrong on LP64
targets (e.g. scalbln was declared taking i32 on x86_64 linux) and on
16-bit targets where long is 32 bits.
Also fix strtoul, strtoull, and the unsigned long operator new/delete
variants to use the unsigned types.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Add signext/zeroext attributes to libcall signatures
Try to match TargetLibraryInfo's behavior. Integer types narrower than
int are extended according to their signedness.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Sparc] Port SparcDetectRoundChange to NewPM
Standard NewPM pass porting.
The idea behind this pass seems to be fundamentally flawed and I'm sure
there's a better way to do this, but I'm trying not to get sucked into
fixing target specific issues as part of the NewPM migration.
Reviewers: arsenm, doac, koachan
Pull Request: https://github.com/llvm/llvm-project/pull/237657
[Sparc] Port InsertNOPLoad to NewPM
Standard NewPM pass porting. Also note we preserve the CFG in the
LegacyPM.
Reviewers: doac, arsenm, koachan
Pull Request: https://github.com/llvm/llvm-project/pull/237654
[Sparc] Remove LEONMachineFunctionPass base class
None of the members were even used, so just delete it. This makes
porting to the NewPM simpler.
Reviewers: arsenm, doac, koachan
Pull Request: https://github.com/llvm/llvm-project/pull/237652
[MC] Save/restore the CFA offset on .cfi_remember_state/.cfi_restore_state (#237678)
.cfi_adjust_cfa_offset and .cfi_rel_offset are encoded relative to the
CFA offset. GNU Assembler saves/restores the offset for
.cfi_remember_state/.cfi_restore_state while we don't. Fix it.