aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2020-09-14 11:49:27 +0100
committerFlorian Hahn <flo@fhahn.com>2020-09-14 12:06:58 +0100
commitf715d81c9df3fb3e047a54899fc749f57c84aeb5 (patch)
treea4e036568b189f5a929992ebefb98e4a1e6b1e61 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parenteef30334d1daaddf8b4e465be7c0f4aa4f98e208 (diff)
downloadllvm-f715d81c9df3fb3e047a54899fc749f57c84aeb5.zip
llvm-f715d81c9df3fb3e047a54899fc749f57c84aeb5.tar.gz
llvm-f715d81c9df3fb3e047a54899fc749f57c84aeb5.tar.bz2
[DSE] Only eliminate candidates that always store the same loc.
AliasAnalysis/MemoryLocation does not account for loops. Two MemoryLocation can be must-overwrite, even if the first one writes multiple locations in a loop. This patch prevents removing such stores, by only considering candidates that are known to be loop invariant, or executed in the same BB. Currently the invariant check is quite conservative and only considers Alloca and Alloca-like instructions and arguments as invariant base pointers. It also considers GEPs with all constant indices and invariant bases as invariant. This can be improved in the future, but the current implementation has only minor impact on the total number of stores eliminated (25903 vs 26047 for the baseline). There are some 2-10% swings for some individual benchmarks. In roughly half of the cases, the number of stores removed increases actually, because we skip candidates that are unlikely to be valid candidates early.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
0 files changed, 0 insertions, 0 deletions