[flang][cuda] Fix predefined variable processing with inlining (#205888)
The pass was skipping some variables when they were inlined inside a cuf
kernel for example.
[LV] Use getSmallBestKnownTC in IV-overflow-check (#195226)
It has the benefit of also handling scalable TCs.
Co-authored-by: Florian Hahn <flo at fhahn.com>
[AArch64] Fix stack protectors with tiny code model. (#205668)
The tiny code model was using the address of the stack protector as the
stack protector, which doesn't provide the expected protection. Fix it
to use the usual adrp+ldr.
[CIR] Fix return type of __cxa_atexit (#205905)
The return type should be 'int', not 'void'. We even have a comment
above the code that generates this that it should be an int.
This patch changes it and updates all the affected tests.
[CIR] Implement ArgKind::Expand in CallConvLowering (#201718)
ArgKind::Expand classifies a struct argument for flattening: each field
becomes a separate scalar argument at the ABI level. Classic CodeGen
calls this "struct expansion" — used on targets like MIPS and some ARM
calling conventions.
CIRABIRewriteContext previously emitted errorNYI at both classification
sites. The replacement covers three call paths. In buildNewArgTypes,
the original struct type is replaced by one wire type per field. In
insertArgCoercion, the single struct block argument is replaced by N
scalar block arguments and an alloca+get_member+store+load sequence at
the entry block reassembles them for body uses; a running block-argument
index (rather than classIdx + sretOffset) correctly tracks the expanded
slot count when multiple Expand args or sret+Expand combinations appear.
The Ignore-drop loop gains a classToBlockArg pre-computation so that
Ignore args following Expand args are erased at the correct index. In
rewriteCallSite, cir.extract_member decomposes the struct operand into
its constituent fields, which become separate call arguments.
[2 lines not shown]
[clang][index][USR] GenLoc prints file entry at most once, allow repeated offsets (#205430)
`GenLoc` previously printed the source location at most once per USR,
gated by a member flag toggled on the first call. During the recursive
visit, if both an outer and an inner decl needed to print the location,
only the outer one was printed. When the outer decl did not need the
offset, no offset was ever printed. For example, the USR of
`Holder<decltype([]{})>::method` depends on the location of the type of
the lambda but the outer decl prints the file entry only, which disables
offset printing.
Change the logic so the file-entry part of the location is printed at
most once (it must be identical), while offsets of sub-decl locations
may be printed multiple times.
rdar://180654884
---------
Co-authored-by: Balázs Benics <benicsbalazs at gmail.com>
[Offload] Unify the kernel argument passing (#205224)
Summary:
Currently we have two conflicting methods of passing kernel arguments, a
flat pointer + size and an array of pointers. We recently decided to
move the offload API to the latter because it is more generic and lets
you construct the other formats.
This PR primarily just changes the format and the one existing core use.
The uses should be simplier now. Future changes will change the OpenMP
argument parsing.
[Clang] Disable C++ exceptions by default for GPU targets (#205402)
Summary:
Exceptions are not supporter, and likely will never be supported, on
GPUs. The SIMT model makes context switching nearly impossible, and
building an unwinder would require stashing a register file that is
over 8 KiB these days. There's precedent to disable this for the target,
so we should just do this.
Offloading languages have their own weird handling, some chimera that
just accepts exceptions but turns them into traps on the device side, so
we leave that unaffected.
[mlir] Fix visitor block erasure (#205854)
I made the visitor test drop block-defined value uses before erasing the
block and added a small regression case.
Fixes #205717
AMDGPU: Avoid default subtarget in hand-written codegen tests (9/9) (#205792)
Fix some manual test checks using amdgcn triples without -mcpu. These
require the most careful consideration. The highest impact changes are the
optimizations removing execz branch now that there's a sched model.
AMDGPU: Avoid default subtarget in hand-written codegen tests (8/9) (#205791)
Introduce the missing -mcpu argument to some tests which are not
autogenerated.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
AMDGPU: Avoid default subtarget in hand-written codegen tests (7/9) (#205790)
Introduce an -mcpu argument to tests missing it to avoid codegening
the default dummy target. These are cases that didn't require adjusting
the check lines.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
[VPlan] Remove unused VPlanPrinter::getOrCreateName(const VPBlockBase*) (#205896)
The block-name printers use getName()/getUID() directly; this overload
has no callers.
[flang][OpenMP] Move clause validity checks into OpenMP-specific code (#205607)
The checks for syntactic properties of clauses (e.g. uniqueness, being
required, etc.) were originally handled by infrastructure common to
OpenMP and OpenACC. That infrastructure, however, is not fully equipped
to handle OpenMP needs: being unable to express version-based properties
or clause set properties being two prominent examples.
The first step towards fulfilling the OpenMP requirements it is to
transfer the handling of clause validity checks into OpenMP-specific
code, which can then be modified without interfering with OpenACC.
In addition to that, this PR also changes the way that clauses on end-
directives are handled: first, a clause appearing on an end-directive is
checked to be allowed to appear on an end-directive, then all clauses
from the begin- and the end-directives are tested together. This unifies
checks for uniqueness of clauses that can appear in both places.