aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authoragozillon <Andrew.Gozillon@amd.com>2025-07-25 16:15:54 +0200
committerGitHub <noreply@github.com>2025-07-25 16:15:54 +0200
commit73272d6fc67ee2c12947912ac50727bde38cb3a3 (patch)
tree7cf989fa9689880827d788c17ec09d432daffde2 /clang/lib/Frontend/CompilerInstance.cpp
parentadb2421202e4014b4986a9f1eb40833dc7ec25ad (diff)
downloadllvm-73272d6fc67ee2c12947912ac50727bde38cb3a3.zip
llvm-73272d6fc67ee2c12947912ac50727bde38cb3a3.tar.gz
llvm-73272d6fc67ee2c12947912ac50727bde38cb3a3.tar.bz2
[Flang][OpenMP] Appropriately emit present/load/store in all cases in MapInfoFinalization (#150311)
Currently, we return early whenever we've already generated an allocation for intermediate descriptor variables (required in certain cases when we can't directly access the base address of a passes in descriptor function argument due to HLFIR/FIR restrictions). This unfortunately, skips over the presence check and load/store required to set the intermediate descriptor allocations values/data. This is fine in most cases, but if a function happens to have a series of branches with seperate target regions capturing the same input argument, we'd emit the present/load/store into the first branch with the first target inside of it, the secondary (or any preceding) branches would not have the present/load/store, this would lead to the subsequent mapped values in that branch being empty and then leading to a memory access violation on device. The fix for the moment is to emit a present/load/store at the relevant location of every target utilising the input argument, this likely will also lead to fixing possible issues with the input argument being manipulated inbetween target regions (primarily resizing, the data should remain the same as we're just copying an address around, in theory at least). There's possible optimizations/simplifications to emit less load/stores such as by raising the load/store out of the branches when we can, but I'm inclined to leave this sort of optimization to lower level passes such as an LLVM pass (which very possibly already covers it).
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
0 files changed, 0 insertions, 0 deletions