[WinEH] Fix crash when aligning parameters larger than ABI (#180905)
Fix #180648 caused by an unhandled `Argument` for parameters exceeding
ABI size limits. This patch explicitly emits an `alloca` for the `Argument` in
the entry block to ensure correct address resolution.
[Clang][layout] Update tests after #182792 (#186019)
\#182792 makes it so that these structs have an alignment of 1. This
needs to be fixed in a recently added test (landed after the most recent
premerge run of the test).
This test update is expected behavior.
[CodeGen][TTI] Reduce funnel shift cost for constant shift amounts (#184942)
The Sub instruction cost and the shift-by-zero handling costs (ICmp +
Select) are only needed when the shift amount is non-constant. Move them
inside the `!OpInfoZ.isConstant()` guard to avoid overestimating cost
for constant shift amounts.
The overestimated scalar cost caused SLP vectorizer to incorrectly
prefer vectorizing funnel shifts with constant shift amounts, since SLP
compares vector cost against scalar cost and a falsely high scalar cost
makes vectorization appear more profitable than it actually is.
Fixes #181308.
[RISCV] Update Andes45 vector permutation scheduling info (#185591)
This PR adds latency/throughput for all RVV permutation instructions to
the andes45 series scheduling model.
We use the default cycle for permutation instructions since we are
unable to model the Latency and ReleaseAtCycles accurately now.
[clang-tidy] Fix spurious errors from builtin macros in modernize-use-trailing-return-type (#184022)
## Summary
I hit the same issue as in #168360 when upgrading to LLVM 21 with
clang-tidy reporting cryptic:
`error: missing '(' after '__has_feature'`
Further investigation confirmed that the issue is localized to
`modernize-use-trailing-return-type` and only happens with C++20+ and llvm
21 system headers (where `__has_feature` started to be used by libc++).
Initial non-localized repro had this error firing 7k+ on LLVM 21, but
when I switched to HEAD the incidence dropped to just 5 'check()' calls
firing. The drop in incidence is likely to be related to
https://github.com/llvm/llvm-project/pull/151035 as there are no other
plausibly relevant changes.
However, as I was still hitting the issue with HEAD, this helped develop
[20 lines not shown]
Fix packed being ignored on ms_struct bitfields (#182792)
For ms_struct structs on Itanium layout targets, the packed attribute is
ignored on bit-fields (2014 commit
76e1818a2b1248579557de2927c135c322577c82), mismatching the GCC behavior.
Remove the `!IsMsStruct` guard to fix it.
MIPSr6: Fix COPY of reg:fgr64cc without fcmp in the same BB (#185820)
There may be some BB to COPY fgr64cc register, and the fgr64cc register
is set by the previous BB.
We add a new pass called MipsSetMachineRegisterFlags, in which we set
We introduce a new pass called MipsSetMachineRegisterFlags, in which we
set NoSWrap flag for all instructions that works with fgr64cc registers.
And in copyPhyRegister, we allow the COPY instruction with NoSignWrap
from the double float registers to gpr32.
[flang] Improve error message for missing primary expression (#185484)
Don't mention the possible expectation that the extension %LOC() could
appear when emitting the error messages for a completely missing primary
expression; it's just confusing.
[flang][cuda] Emit CUDA attributes in type declarations in mod files (#185462)
The compiler implements CUDA object entity attributes in module files by
emitting "attributes()" statements after the type declaration statement
for the object. This works fine for variables, but not at all for
derived type components -- the "attributes()" statement is not allowed
in a derived type definition, and the module file isn't readable later
when USE'd. The fix is to emit the attribute as part of the type
declaration statement or component declaration statement instead.
[lldb] Update TestProcessCrashInfo for MTE (#185808)
With MTE, the issue is caught by hardware and libmalloc records a
different message: "BUG IN CLIENT OF LIBMALLOC: MTE tag mismatch
(probable double-free)". Update the test accordingly.
[lldb] Use raw address in "memory history" command (#185812)
The `memory history` command was using `ToAddress` for its address
argument, which strips non-addressable bits (including MTE tag bits) via
`FixAnyAddress`. This caused us to pass a stripped address to
`__asan_get_alloc_stack`/`__asan_get_free_stack`, which is incorrect.
Switch to `ToRawAddress` to preserve the complete address, including the
MTE tag, so we can look up the correct address.
[lldb] Use SBProcess.FixAddress in address_ranges_helper.py (#185802)
Use `SBProcess.FixAddress` in `address_ranges_helper.py` to support
arm64e and ARM's Memory Tagging Extension (MTE) which rely on TBI to
encode data in the top byte, which in this mode is ignored by the HW.
This fixes TestFindInMemory.py and TestFindRangesInMemory.py when
running the LLDB test suite with MTE.
[mlir][OpenMP] Translate omp.declare_simd to LLVM IR
This mod aim to generate same vector ABI [1] for declare simd as Clang
and reuse function paramater mangling and codegen logic authored by
@alexey-bataev in [2].
Codegen for AArch64 is not included in this patch.
For each omp.declare_simd, lowering computes:
ParamAttrs: one entry per function argument, classifying it as
Vector / Uniform / Linear (+ step or var-stride) / Aligned.
Branch kind: Undefined / Inbranch / Notinbranch.
VLEN: either from simdlen(...) or derived from the CDT size.
llvm then emits x86 declare-simd variants by attaching mangled
function attributes of the form:
_ZGV _
where:
[11 lines not shown]
[CIR] Preserve attributes when converting call to try_call (#185782)
This adds code to preserve any attributes, including parameter and
return value attributes, that were present on a call operation that is
being replaced with a try_call operation.
[DirectX] Specify element-aligned vectors (#180622)
Use the new "ve" Data Layout specifier to indicate that vectors are
element-aligned for the target.
Part of #123968
[RISCV][P-ext] Remove unncessary patterns for setgt/setugt. NFC (#185971)
We mark these CondCodes as Expand so LegalizeDAG will turn them into
setlt/setult.
[lldb][bytecode] Add swift output to Python->bytecode compiler (#185773)
For swift projects using the compiler, having a swift output option will
make it easier to integrate bytecode formatters into the build.
[LLDB] Fix null pointer dereference. (#185985)
The code was declaring a shared poiner and then immediately trying to
dereference it to initialize it's contents, but the dereference was
giving a seg fault. This fixes that issue.
[ObjC] Emit class msgSend stub calls (#183923)
Instead of translating class messages to `objc_msgSend` calls, clang now
emits calls to stub functions that are synthesized by the linker. Each
stub loads the class reference and the selector name and forwards them
to `objc_msgSend`.
The stub function is named using the following format:
`objc_msgSendClass$selName$_OBJC_CLASS_$_className`
Note that the optimization is disabled in the following cases:
- When the class name is unknown at compile time (e.g, `[id
classMethod]`).
- The selector name contains a `$`, which serves as the delimiter in
stub
function names.
- The class is annotated with either `objc_class_stub` or
`objc_runtime_visible`.
[14 lines not shown]
Revert "[libclc][NFC] Change include style from <...> to "..."" (#185888)
Reverts llvm/llvm-project#185788. This change is causing test
regressions in libclc, so it's definitely not "NFC", and with its size
it's hard to figure out what exactly went wrong.