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 | c6fa6d25ab52d89b892773762681814afe6f3928 (patch) | |
| tree | fad4c01cd70050b4219b32a30a8b6d2895adbfde /llvm | |
| parent | fbd2c6a022f34e70bda2f08a807338aa42cc00d9 (diff) | |
| download | bcm5719-llvm-c6fa6d25ab52d89b892773762681814afe6f3928.tar.gz bcm5719-llvm-c6fa6d25ab52d89b892773762681814afe6f3928.zip | |
Small optimization to speed up replacementPreservesLCSSAForm.
llvm-svn: 122600
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Analysis/LoopInfo.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h index 612b7b8cc49..a35b125d6f5 100644 --- a/llvm/include/llvm/Analysis/LoopInfo.h +++ b/llvm/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()); |

