aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authoragozillon <Andrew.Gozillon@amd.com>2024-07-03 21:44:50 +0200
committerGitHub <noreply@github.com>2024-07-03 21:44:50 +0200
commita1bc606b5fb9a91eb16fc0c012aa785323788c90 (patch)
tree56aa8862a1075baee23bfba8dcaa7d6cd7e5315e /llvm/lib/Transforms/Utils/SimplifyCFG.cpp
parent7002ecb4c6dba2050b321699e0e17eb890c3ca2c (diff)
downloadllvm-a1bc606b5fb9a91eb16fc0c012aa785323788c90.zip
llvm-a1bc606b5fb9a91eb16fc0c012aa785323788c90.tar.gz
llvm-a1bc606b5fb9a91eb16fc0c012aa785323788c90.tar.bz2
[Flang][Transform] Modify stack reclaim pass to use allocation address space when generating intrinsics (#96836)
This PR aims to factor in the allocation address space provided by an architectures data layout when generating the intrinsic instructions, this allows them to be lowered later with the address spaces in tow. This aligns the intrinsic creation with the LLVM IRBuilder's https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/IR/IRBuilder.h#L1053 This is also necessary for the below example to compile for OpenMP AMD GPU and not ICE the compiler in ISEL as AMD's stackrestore and stacksave are expected to have the appropriate allocation address space for AMD GPU. program main integer(4), allocatable :: test allocate(test) !$omp target map(tofrom:test) do i = 1, 10 test = test + 50 end do !$omp end target deallocate(test) end program The PR also fixes the issue I opened a while ago which hits the same error when compiling for AMDGPU: https://github.com/llvm/llvm-project/issues/82368 Although, you have to have the appropriate GPU LIBC and Fortran offload runtime (both compiled for AMDGPU) added to the linker for the command or it will reach another ISEL error and ICE weirdly. But with the pre-requisites it works fine with this PR.
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
0 files changed, 0 insertions, 0 deletions