From: Duncan Sands Date: Tue, 28 Dec 2010 18:00:24 +0000 (+0000) Subject: Small optimization to speed up replacementPreservesLCSSAForm. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9bc6a90146417af03144fa2f7dd94f9945b57c06;p=oota-llvm.git Small optimization to speed up replacementPreservesLCSSAForm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122600 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Analysis/LoopInfo.h b/include/llvm/Analysis/LoopInfo.h index 612b7b8cc49..a35b125d6f5 100644 --- a/include/llvm/Analysis/LoopInfo.h +++ b/include/llvm/Analysis/LoopInfo.h @@ -1029,6 +1029,10 @@ public: // instruction. Instruction *I = dyn_cast(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());