[Clang][OpenMP] Don't mark outlined parallel region functions norecurse (#218862)
Clang marks every outlined OpenMP region function `norecurse`, in both
`emitOutlinedFunctionPrologue` and
`emitOutlinedFunctionPrologueAggregate`, and
does the same for the GPU parallel wrapper. For a `parallel` region that
is not
true: the body is reached through the function pointer the runtime is
handed, and
if the body opens another parallel region the runtime's parallel entry
is
re-entered while the first call is still live, so the entry and the body
sit in a
call graph cycle. `rpo-function-attrs` propagates the annotation off the
body and
onto the device runtime's parallel entry once internalization makes it
internal,
and a nested parallel region can then be folded away.
[18 lines not shown]
RegisterCoalescer: Remove empty subranges after merging subranges
Merging subranges in joinVirtRegs didn't try to clear empty ranges after
refineSubRanges, manifesting in an assert in overlaps checks later.
Exposed with subregister liveness once LiveIntervals runs before TwoAddress.
Co-authored-by: Claude (Claude-Opus-4.8)
[flang] Enable FP sum reassociation by default (#218746)
Enable Fortran-standard-compliant reassociation within individual REAL
and COMPLEX sum expressions by default at all optimisation levels.
Preserve the explicit positive and negative Flang override flags.
Also enable by default on bbc to match flang.
RFC:
https://discourse.llvm.org/t/rfc-flang-reasssociate-within-real-and-complex-expressions-by-default/91626
Assisted-by: Codex
[GlobalISel] Drop redundant scalable-dest check in G_EXTRACT_SUBVECTOR lowering (NFC) (#221934)
The scalarizing lowering of G_EXTRACT_SUBVECTOR bails out for both a
scalable source and a scalable destination.
According to llvm/docs/GlobalISel/GenericOpcode.md, G_EXTRACT_SUBVECTOR
only supports extracting a fixed vector from a scalable vector, never a
scalable vector from a fixed one.
This means that a fixed source implies a fixed destination, making the
DstTy.isScalable() check redundant.
Remove it. NFC.
[AMDGPU] Avoid dangling SSAUpdater reference in PromoteAlloca full-vector store (#215686)
promoteAllocaToVector walks alloca users in use-list order across
blocks. A full-vector store forwards its value operand to the
SSAUpdater, and that operand can be a load from the same alloca in a
dominating block. If the store is visited first, the SSAUpdater holds a
raw pointer to the load; the load is later RAUW'd and deleted, leaving a
dangling reference that causes a crash.
Fix by sorting blocks in reverse post-order before visiting them, so a
forwarded load is always replaced before any store hands it to the
SSAUpdater.
Assisted-By: Cursor (Claude)
---------
Co-authored-by: Cursor <cursoragent at cursor.com>
[AMDGPU] Restrict DPP combine from performing bad transformations when handling certain REV insts that use Src1 as the DPP operand (#216835)
This issue was originally discovered due to a benchmark failure in the
downstream. The REV subtractions have always worked this way, and the
REV shift operands worked this way before GFX11
[LLVM] Add missing link library `TargetParser` to `LLVMOrcShared`
When building with shared libraries, I've got:
```
/usr/bin/ld:
lib/ExecutionEngine/Orc/Shared/CMakeFiles/LLVMOrcShared.dir/Mangler.cpp.o:
in function `llvm::orc::Mangler::fromTriple(llvm::Triple const&,
llvm::StringRef)':
/llvm/lib/ExecutionEngine/Orc/Shared/Mangler.cpp:50:
undefined reference to
`llvm::Triple::computeDataLayout[abi:cxx11](llvm::StringRef) const'
```
[MLIR][linalg] Share external interface implementations to reduce build time (NFC) (#221814)
The Linalg tiling and partial-reduction external models instantiate
their operation-independent implementations for every registered
structured op. Keep thin operation-specific external models, but inherit
the implementations from non-template bases so the compiler emits and
optimizes them only once.
Assisted-by: Codex
[MLIR][linalg] Handle invalid elementwise kind safely (#221835)
The generic elementwise builder accepts an attribute list. Avoid passing
an uninitialized kind to region construction if a caller omits the
required kind, and reject attributes of the wrong type rather than
relying on an assertion.
Found by Coverity.
Assisted-by: Codex
[SandboxVec][Scheduler][NFC] Rename ScheduleTopItOpt to ScheduleFrontier (#220409)
We now have an actual class `SchedulingPoint` for pointing to the top of
schedule, so it is no longer an iteraterator as `ScheduleTopItOpt` would
imply. We also support both bottom-up and top-down directions so "Top"
is no longer a good name.
This patch renames the iterator to ScheduleFrontier.
[IRBuilder][GlobalISel] Add byte ptr cast support in IRBuilder
Fix handling of byte-ptr casts in CreateBitPreservingCastChain.
Add G_BITCAST lowering in IRTranslator, emit G_INTTOPTR / G_PTRTOINT
if the type shape does not match.
devel/libvirt: run virt-host-validate in rc script
Update the libvirtd rc script to run virt-host-validate(1)
before running libvirtd(8). This command provides information
about possibly missing kernel modules required for certain
features of libvirtd. Errors and warnings from this tool do not
prevent libvirtd(8) from starting as most of the features
are optional.
Suggested by: arrowd
Reviewed by: arrowd
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59490
[Driver][Clang] Add -nodefaultrtlibs (#219496)
On z/OS testing compiler-rt does not work with the -nodefaultlibs since
that option remove both the standard libraries like libc and the
compiler-rt library. On other platforms adding an argument like `-lc`
back to the command line in the test scripts works because the path for
libc (eg. `-L<path>`) hadn't been removed. On z/OS, the standard
libraries are located in data sets and you need to specify them by
complete name (eg. `<HLQ>.SCEELIB(CELQS003)`).
This is adding the option `-nodefaultrtlibs` so the compiler-rt tests
can remove just the compiler-rt libs from the link step.
[lldb] Fix switch case for i386 in COFF GetModuleSpecifications (#222030)
08c94c0ac3b503dd4971da8935001aba01918688 / #188276 accidentally removed
the "case:" for i386.
[flang][cuda] Inline scalar-to-array assignments in CUDA Fortran device code at -O0 (#221333)
At -O0, `arr = 11` lowers to a `_FortranAAssign` call. In device code
the runtime function's callees join the kernel's call graph, so the
device linker reserves a worst-case stack frame for every kernel
reaching it: `65,720` bytes per thread for a kernel with one such
assignment, versus `0` at -O1.
`InlineHLFIRAssign` already runs at -O0 with `onlyScalarRHS` for OpenMP
target device compilations. This extends that carve-out to CUDA Fortran.
Since a CUDA Fortran module holds both host and device code, the
decision is per-operation via `cuf::isCUDADeviceContext`, and host code
keeps the runtime call.
Only scalar-to-array broadcast is covered.
[Clang] Fix assertion when a Unicode character is splatted to a vector of its own type (#219987)
Fixes #202317
Comparing an `ext_vector_type` of `char32_t` against one of its own
elements (`V.xyzw < V.x`) splats the scalar to the vector type, and
`-Wconversion` checking then trips `Source != Target` in
`DiagnoseMixedUnicodeImplicitConversion`. `CheckImplicitConversion` does
reject `Source == Target` at the top, but only on the outer types; when
it later strips the vector wrapper off the target it ends up with
`char32_t` on both sides and nothing re-checks that. Every other element
check just happened to tolerate identical types silently, the Unicode
one is the first to assert, which is why this only showed up as a Clang
21 regression.
The fix is at the call site rather than in the diagnostic: once the
vector, matrix and SVE wrappers have been stripped, return early if the
element types are the same. That covers matrix splats and HLSL
truncation to the same element type too, not just this one warning, and
[5 lines not shown]
AMDGPU: Remove xnack and sramecc subtarget features
Now that these are controlled by module flags, the subtarget
features were just used for assembler and disassembler controls.
Now that the assembler and disassembler can infer these from
the e_flags and target directives, they are no longer necessary.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>