diff options
author | Duncan Sands <baldrick@free.fr> | 2010-12-28 18:00:24 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2010-12-28 18:00:24 +0000 |
commit | 9bc6a90146417af03144fa2f7dd94f9945b57c06 (patch) | |
tree | f7fecdd8e0d0e372fa3ced90c7089da53da4c60b /include | |
parent | e21083aa3a79506f896d95d7147c3c4627a77ef0 (diff) | |
download | external_llvm-9bc6a90146417af03144fa2f7dd94f9945b57c06.zip external_llvm-9bc6a90146417af03144fa2f7dd94f9945b57c06.tar.gz external_llvm-9bc6a90146417af03144fa2f7dd94f9945b57c06.tar.bz2 |
Small optimization to speed up replacementPreservesLCSSAForm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122600 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/LoopInfo.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index 612b7b8..a35b125 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -1029,6 +1029,10 @@ public: // instruction. Instruction *I = dyn_cast<Instruction>(To); if (!I) return true; + // If both instructions are defined in the same basic block then replacement + // cannot break LCSSA form. + if (I->getParent() == From->getParent()) + return true; // If the instruction is not defined in a loop then it can safely replace // anything. Loop *ToLoop = getLoopFor(I->getParent()); |