[llvm-commits] [llvm] r122600 - /llvm/trunk/include/llvm/Analysis/LoopInfo.h
Duncan Sands
baldrick at free.fr
Tue Dec 28 10:00:24 PST 2010
Author: baldrick
Date: Tue Dec 28 12:00:24 2010
New Revision: 122600
URL: http://llvm.org/viewvc/llvm-project?rev=122600&view=rev
Log:
Small optimization to speed up replacementPreservesLCSSAForm.
Modified:
llvm/trunk/include/llvm/Analysis/LoopInfo.h
Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=122600&r1=122599&r2=122600&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue Dec 28 12:00:24 2010
@@ -1029,6 +1029,10 @@
// 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());
More information about the llvm-commits
mailing list