aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authoragozillon <Andrew.Gozillon@amd.com>2023-11-15 15:45:32 +0100
committerGitHub <noreply@github.com>2023-11-15 15:45:32 +0100
commit718793ce6a54b8fb95884d7fb37f70fd339cab3b (patch)
treee88da667e00a6977c72ca19641fdaf0a7f16c804 /flang/lib/Frontend/CompilerInvocation.cpp
parentb7b6d54004ef8a89dc3bad411f11a1ef93319a13 (diff)
downloadllvm-718793ce6a54b8fb95884d7fb37f70fd339cab3b.zip
llvm-718793ce6a54b8fb95884d7fb37f70fd339cab3b.tar.gz
llvm-718793ce6a54b8fb95884d7fb37f70fd339cab3b.tar.bz2
[OpenMP][OMPIRBuilder] Handle replace uses of ConstantExpr's inside of Target regions (#71891)
Currently there's an edge cases where constant indexing in target regions can lead to incorrect results as we do not correctly replace uses of mapped variables in generated target functions with the target arguments (and accessor instructions) that replace them. This patch seeks to fix that by extending the current logic in the OMPIRBuilder. Things like GEP's can come in the form of Constants/ConstantExprs, Constants and ConstantExpr's do not have access to the knowledge of what they're contained in, so we must dig a little to find an instruction so we can tell if they're used inside of the function we're outlining so we can be sure they are replaceable and we are not accidentally replacing a usage somewhere else in the module that's still necessary. This patch handles these by replacing the original constant expression with a new instruction equivalent; an instruction as it allows easy modification in the following loop, as we can now know the constant (instruction) is owned by our target function (as it holds this knowledge) and replaceUsesOfWith can now be invoked on it (cannot do this with constants it seems), a brand new one also allows us to be cautious as it is perhaps possible the old expression was used inside of the function but exists and is used externally (unlikely by the nature of a Constant, but still a positive side affect).
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions