[flang][PFT-to-MLIR] Default wrap-unstructured-constructs-in-execute-region to off
Flip the default of `-wrap-unstructured-constructs-in-execute-region`
from true to false while further miscompiles under the wrap path are
investigated. The flag is still available; lit tests that exercise the
wrap path now pass it explicitly on their RUN lines.
Co-Authored-By: Claude Sonnet 4.6 <noreply at anthropic.com>
[libunwind][AIX] Handle VAPI-based return addresses in stack unwinding for LLU (#209280)
In AIX's implementation of LLU (Live Library Update), the caller of a
Virtual API (VAPI) interface instead calls VAPI glue and the
implementation for a VAPI function is entered from the VAPI glue. If a
VAPI is not already active on the thread, the VAPI calls the
implementation of the VAPI function with the link register (LR) value
set to a return address in the VAPI glue. In this case, the LR (return
address) value on entry to the VAPI glue is saved in the VAPI control
block. This PR checks whether the return address in a stack frame falls
within the VAPI address range. If it does, the unwinder retrieves the LR
value from the VAPI control block and uses it as the return address
during stack unwinding. In addition, before transferring control to a
landing pad, this PR executes the VAPI return glue to clear the VAPI
control block if the VAPI glue was used.
---------
Co-authored-by: Hubert Tong <hubert.reinterpretcast at gmail.com>
[offload-arch] Fix amdgpu HIP DLL search path on Windows (#209898)
## Motivation
This follows up on https://github.com/llvm/llvm-project/pull/194063 to
fix https://github.com/ROCm/TheRock/issues/6571, where `offload-arch`
distributed as part of ROCm has been failing with:
```diff
D:\projects\TheRock (main -> upstream)
λ .\build\dist\rocm\lib\llvm\bin\offload-arch.exe --verbose
Found HIP runtime: D:/projects/TheRock/build/dist/rocm/bin/amdhip64_7.dll
-note: priming LoadLibraryExW failed for D:/projects/TheRock/build/dist/rocm/bin/amdhip64_7.dll (error 126)
Failed to load D:/projects/TheRock/build/dist/rocm/bin/amdhip64_7.dll: D:/projects/TheRock/build/dist/rocm/bin/amdhip64_7.dll: Can't open: The specified module could not be found. (0x7E)
Failed to 'dlopen' libcuda.so.1
Unable to load library 'libze_loader.so': libze_loader.so: Can't open: The specified module could not be found. (0x7E)
```
## Fix details
[47 lines not shown]
[RuntimeDyld][COFF] Apply addend for IMAGE_REL_AMD64_SECREL (#211015)
`IMAGE_REL_AMD64_SECREL` currently falls through the default case. Its
`Addend` is built using the target symbol's section offset. This is
incorrect: for a SECREL against a section symbol (offset 0), the real
value is stored as the addend in the relocated field. This results in
the SECREL writer always writing 0, which is wrong.
This patch reads the 4-byte field addend for SECREL, as `REL32` and
`ADDR64` already do. It also adds a test which fails without this.
Source: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format
[flang][PFT-to-MLIR] Default wrap-unstructured-constructs-in-execute-region to off
Flip the default of `-wrap-unstructured-constructs-in-execute-region`
from true to false while further miscompiles under the wrap path are
investigated. The flag is still available; lit tests that exercise the
wrap path now pass it explicitly on their RUN lines.
Co-Authored-By: Claude Sonnet 4.6 <noreply at anthropic.com>
[LLDB] Disable Foundation test on newer versions of macOS (#211127)
On macOS >= 27 Foundation caches the path of a URL-initialized
NSBundle as a native Swift String. We cannot format that without the
Swift language plugin.
Add a requiresSwiftPlugin() decorator in decorators.py and use it for
the NSBundle formatter test. It expects failure only when LLDB lacks the
Swift plugin, and only on Apple targets at or after a given OS version
(checked against the target platform, so it is correct for
iOS/tvOS/watchOS/visionOS as well as macOS). Builds with the plugin are
expected to pass.
Assisted-by: claude
[mlir][OpenACC] Support static multi-rank OpenACC array reduction accumulators (#210853)
Example:
```fortran
!$acc parallel loop reduction(+:a)
do i = 1, n
a(i,:) = a(i,:) + input(i,:)
end do
```
In this code, the reduction accumulator can have rank greater than one,
but GPU lowering assumes rank one.
Fix: initialize rank-N accumulators with nested loops and delinearize
flattened indices before loading, reducing, and storing each element.
[Hexagon] Drop NodeAddr::operator<, fix bad asserts directives (#210192)
Removed NodeAddr::operator< that was added by mistake in #207082.
Nothing needed it once HexagonPostRAHandleQFP.cpp's containers went back
to keying on NodeId.
Also removed the contradictory UNSUPPORTED+REQUIRES asserts in two
tests; subreg2 still crashes so it's XFAIL'd for now.
[AMDGPU] Add synthetic apertures and use them for barriers
Define what a synthetic aperture is, and adjust the barrier AS
to use this new system. This makes the barrier AS even safer to
use as now we can use all 32 bits of it without ever risking
hitting a valid address of any kind (LDS or outside LDS).
[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.
[openmp][cmake] Match GPU triples consistently in openmp/module (#211138)
Fixes #211135.
`openmp/module/CMakeLists.txt:29` gates the GPU-only Fortran compile
options on `"^amdgcn|^nvptx"`, while `openmp/CMakeLists.txt:176-177`
selects host-vs-device layout for the same build using
`"^amdgpu|^amdgcn|^nvptx|^spirv64"` against both
`LLVM_DEFAULT_TARGET_TRIPLE` and `CMAKE_CXX_COMPILER_TARGET`.
All four offload cache files use the triple `amdgpu-amd-amdhsa`, which
`^amdgcn` does not match, so `-nogpulib -flto` are silently not applied
to `libomp-mod` in the recommended AMDGPU offload configurations.
Compute the test once as `LIBOMP_TARGET_IS_GPU` in
`openmp/CMakeLists.txt` and use it at both sites, rather than
duplicating a widened regex. The conditions differ, not just the
patterns: copying the regex alone would leave a build that sets
`CMAKE_CXX_COMPILER_TARGET` without `LLVM_DEFAULT_TARGET_TRIPLE` still
[33 lines not shown]
[clang] Emit diagnostic for typedef+auto missed case in C++98/C23 (#210141)
CheckTypeSpec() converted 'auto' to a storage-class specifier without
checking whether 'typedef' was already set. [dcl.stc]p1 unconditionally
forbids typedef alongside any storage-class specifier regardless of C++
version.
This change add the check for tydef in the code handling auto.