summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-12-28 18:00:24 +0000
committerDuncan Sands <baldrick@free.fr>2010-12-28 18:00:24 +0000
commit9bc6a90146417af03144fa2f7dd94f9945b57c06 (patch)
treef7fecdd8e0d0e372fa3ced90c7089da53da4c60b /include
parente21083aa3a79506f896d95d7147c3c4627a77ef0 (diff)
downloadllvm-9bc6a90146417af03144fa2f7dd94f9945b57c06.tar.gz
llvm-9bc6a90146417af03144fa2f7dd94f9945b57c06.tar.bz2
llvm-9bc6a90146417af03144fa2f7dd94f9945b57c06.tar.xz
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.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h
index 612b7b8cc4..a35b125d6f 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());