diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-10-13 22:14:57 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-10-13 22:14:57 +0000 |
commit | b414142036012dd9432c4e8c5fef09d4d49fcc22 (patch) | |
tree | fa6b0cb06b5c1963e7b09bd5a9dd39809560cb93 /lib/Transforms/Scalar/DeadStoreElimination.cpp | |
parent | 48ba0e45ed68689ce7b384578e6272410e4e23fe (diff) | |
download | external_llvm-b414142036012dd9432c4e8c5fef09d4d49fcc22.zip external_llvm-b414142036012dd9432c4e8c5fef09d4d49fcc22.tar.gz external_llvm-b414142036012dd9432c4e8c5fef09d4d49fcc22.tar.bz2 |
Enhance the memdep interface so that users can tell the difference between a dependency which cannot be calculated and a path reaching the entry point of the function. This patch introduces isNonFuncLocal, which replaces isUnknown in some cases.
Patch by Xiaoyi Guo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/DeadStoreElimination.cpp')
-rw-r--r-- | lib/Transforms/Scalar/DeadStoreElimination.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index ffa7709..a593d0f 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -441,7 +441,7 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { // Ignore any store where we can't find a local dependence. // FIXME: cross-block DSE would be fun. :) - if (InstDep.isNonLocal() || InstDep.isUnknown()) + if (!InstDep.isDef() && !InstDep.isClobber()) continue; // If we're storing the same value back to a pointer that we just @@ -477,7 +477,7 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { if (Loc.Ptr == 0) continue; - while (!InstDep.isNonLocal() && !InstDep.isUnknown()) { + while (InstDep.isDef() || InstDep.isClobber()) { // Get the memory clobbered by the instruction we depend on. MemDep will // skip any instructions that 'Loc' clearly doesn't interact with. If we // end up depending on a may- or must-aliased load, then we can't optimize @@ -545,7 +545,7 @@ bool DSE::HandleFree(CallInst *F) { MemDepResult Dep = MD->getDependency(F); - while (!Dep.isNonLocal() && !Dep.isUnknown()) { + while (Dep.isDef() || Dep.isClobber()) { Instruction *Dependency = Dep.getInst(); if (!hasMemoryWrite(Dependency) || !isRemovable(Dependency)) return MadeChange; |