[flang-rt][test] Fix write01.f90 missing LD_LIBRARY_PATH (introduced in #187662)
The test binary was run without setting LD_LIBRARY_PATH, causing
libflang_rt.runtime.so to not be found at runtime. Match the pattern
used by exec.f90 and ctofortran.f90.
Co-Authored-By: Claude Sonnet 4.6 <noreply at anthropic.com>
[PassBuilder] Consistently use isLTOXxx helper functions (NFC) (#196290)
In `PassBuilderPipelines.cpp`, we sometimes use `isLTOPreLink()`/etc
helper functions and sometimes direct comparison against elements of the
`ThinOrFullLTOPhase` enum.
This patch add a few more helper functions and makes the code
consistently use them.
Revert "[SLP] Vectorize struct-returning intrinsics" (#198265)
It causes assertions failure such as this one. See discussion on the PR.
Constants.cpp:2802:
static Constant *llvm::ConstantExpr::getInsertElement(Constant *,
Constant *, Constant *, Type *): Assertion `Val->getType()->isVectorTy()
&&
"Tried to create insertelement operation on non-vector type!"' failed.
> Allow SLP to combine across lanes calls that return a literal struct
> (llvm.sincos, llvm.*.with.overflow, llvm.frexp, ...) into a single
> call returning a struct of vectors, by widening {T, T, ...} to
> {<VF x T>, ...} via VectorTypeUtils and emitting extractvalue +
> extractelement for external uses.
>
> Original Pull Request:
https://github.com/llvm/llvm-project/pull/195521
>
[22 lines not shown]
[MLIR][ExecutionEngine] Revert stream/event teardown error suppressions (#194440)
#190717 fixed the race that produced CUDA_ERROR_CONTEXT_IS_DESTROYED on
mgpuStreamDestroy, mgpuStreamWaitEvent, mgpuEventDestroy, and
mgpuEventSynchronize. This changes restores CUDA_REPORT_IF_ERROR on
those four sites.
Keep the CUDA_ERROR_DEINITIALIZED tolerance on mgpuModuleUnload because
that's a separate global-destructor ordering issue, and an error on
module unload is benign anyway.
This is a partial revert of #190563.
Assisted-by: Claude
[VPlan] Remove Def pointer from for VPSingleDefRecipes (NFC) (#195483)
For VPSingleDefRecipe, the VPRecipeValue's Def pointer always points
back to the containing VPRecipeBase, which is computable via
static_cast.
Introduce 2 VPRecipeValue subclasses to distinguish the VPValues defined
by VPSingleDefRecipes (VPSingleDefValue), and VPStandaloneValue for
other recipes.
The former does not need to store a pointer to the defining recipe, as
it can be computed via static_cast. This saves 8 bytes for most recipes.
I plan to use the extra bytes to store the type directly in VPValue as
follow-ups.
PR: https://github.com/llvm/llvm-project/pull/195483
Reapply "[SCEV] Introduce loop-uniform SCEV classification." (#196357)
This reverts commit 45d94f67b84bdc5a85aa8e3c5c266914062dcfef.
This recommit contains a small fix: when `loop-computable` are mixed
with `loop-uniform`, it returns `loop-variant (unknown)`.
Original message:
This patch extends `ScalarEvolution::LoopDisposition` with a new
`LoopUniform` state to describe SCEVs that are invariant across all
iterations of a given loop, but may still depend on inner-loop induction
variables.
Unlike `LoopInvariant`, which requires the value to be fully invariant
with respect to the loop, LoopUniform captures expressions that do not
depend on the loop’s own induction variables, yet may vary in nested
loops. This distinction is useful for analyses and optimizations that
reason about per-iteration stability at a specific loop level.
[12 lines not shown]
[SPIR-V] Route ISel errors through diagnoseUnsupported (#196899)
Replace report_fatal_error in ISel with diagnoseUnsupported so user gets
readable diagnostics with source location instead of simple errors
[OpenCL] Allow mesa3d OS in spirv32 and spirv64 targets (#197148)
Fix libclc `spirv32-mesa-mesa3d` target build error: unknown target
triple 'spirv32-mesa-mesa3d'
Fix libclc `spirv-mesa-mesa3d` target build error: SPIR-V target
requires a Vulkan environment.
mesa3d is a valid OS in llvm triple. This PR enables libclc build for
spirv32-mesa-mesa3d and spirv64-mesa-mesa3d targets.
Note previously spirv[64]-mesa3d- targets used spir[64]-unknown-unknown.
This PR canonicalizes the triples to spirv32[64]-mesa-mesa3d.
[LifetimeSafety] Fix lifetimebound fix-it location for defaulted parameters (#198092)
Earlier, we placed the attribute after the full parameter declaration.
Now, in the default-argument case, we place it after the parameter name.
Fixes #192271
[llvm-objdump][RISCV] Use ISA mapping symbols for per-region disassembly (#193448)
llvm-objdump now honours "$x<ISAString>" mapping symbols emitted by the
RISC-V assembler to select the correct instruction decoder for each code
region.
Note that this also makes the --mattr= option of llvm-objdump much less
useful (only regions without an ISA mapping symbol are affected by
--mattr=).
The implementation also caches parsed ISA mapping symbols. We learned
this lesson from our downstream binutils implementation, where the first
version had no cache and made disassembling large binaries very slow, so
I decide introduce cache from the beginning here.
Test changes summary:
- zibi-valid.s: fix a bug where the rv64 test did not pass +64bit to
llvm-objdump, so address operands were not printed correctly.
[16 lines not shown]
[LLDB] Include components of settings paths in apropos search (#194873)
Fixes #188479.
`apropos` was previously only looking at the "name" of the setting,
which is the final part of what I as a user think of as the "name" as in
the "platform.plugin.something.something-else" form. That that form is
in fact the "qualified name".
In this change, I've extended apropos to look in the paths of settings,
that is the part of the settings name isn't the final name. For example,
"qemu-user" will now show a "path" as a result, which you can then look
up with "settings list".
(the alternative was to apply the search to the qualified name of all
settings, but this would result in a lot of results for top level things
like "platform")
This is the new behaviour:
[37 lines not shown]
[clang] Fix OSAtomicCompareAndSwap* bodyfarm crash (#197489)
When the user-declared OSAtomicCompareAndSwap* prototype has mismatched
oldValue/ newValue/ *theValue types, BodyFarm previously asserted while
synthesizing the body. It should bail out gracefully and let the
analyzer fall back to generic call semantics.
Fixes #197211
Fix for the crash reproduced with:
https://godbolt.org/z/9dcb837YE
```
int foo = 0;
bool OSAtomicCompareAndSwap(char32_t __oldValue, int __newValue,
volatile int *__theValue);
void baz() {
if (OSAtomicCompareAndSwap(0, 0, &foo))
[2 lines not shown]
[LICM][NFC] Factor canHoistLoad out of canSinkOrHoistInst into LoopUtils (#197870)
This patch moves the load-only legality logic from `canSinkOrHoistInst`
into a new `canHoistLoad` helper, declared in
`llvm/Transforms/Utils/LoopUtils.h` and defined in `LICM.cpp`.
`canSinkOrHoistInst` delegates to it for `LoadInst`, so its behavior is
unchanged.
This exposes the load-hoist check for reuse by other passes (e.g. the
GVN min-finding select transform in PR #162259).
[AMDGPU][SIMemoryLegalizer] Consider scratch operations as NV=1 if GAS is disabled
- Clarify that `thread-private` MMO flag is still useful.
- If GAS is not enabled (which is the default as of last patch), consider an op as `NV=1` if it's a `scratch_` opcode, or if the MMO is in the private AS.
- Add tests for the new cases.
- Update AMDGPUUsage GFX12.5 memory model
[RFC][AMDGPU] Add BARRIER address space
Add a new BARRIER address space that is used for global variables that are used to represent the barrier IDs in GFX12.5.
These barrier addresses just have values corresponding 1-1 to barrier IDs. They are still implemented on top of LDS, but the offsetting happens during an addrspacecast to generic, not whenever the barrier GV is used.
The motivation for this is to make the relation between LDS and barrier GVs explicit in the compiler. It does add a bit more complexity, but that complexity was already there, just hidden by pretending barrier GVs were actual LDS.