aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2023-04-27 13:43:11 +0100
committerJay Foad <jay.foad@amd.com>2023-04-28 14:50:48 +0100
commit56af0e913ce7ec29690cc7295d75fc5573153bbf (patch)
treeb8dd4209e8015f355d19b7495e99c8ce00533557 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent5534d1d834c25ec6a3755a44b46e2489b7d0ccf9 (diff)
downloadllvm-56af0e913ce7ec29690cc7295d75fc5573153bbf.zip
llvm-56af0e913ce7ec29690cc7295d75fc5573153bbf.tar.gz
llvm-56af0e913ce7ec29690cc7295d75fc5573153bbf.tar.bz2
[EarlyCSE] Do not CSE convergent calls in different basic blocks
"convergent" is documented as meaning that the call cannot be made control-dependent on more values, but in practice we also require that it cannot be made control-dependent on fewer values, e.g. it cannot be hoisted out of the body of an "if" statement. In code like this, if we allow CSE to combine the two calls: x = convergent_call(); if (cond) { y = convergent_call(); use y; } then we get this: x = convergent_call(); if (cond) { use x; } This is conceptually equivalent to moving the second call out of the body of the "if", up to the location of the first call, so it should be disallowed. Differential Revision: https://reviews.llvm.org/D149348
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
0 files changed, 0 insertions, 0 deletions