[llvm-commits] [llvm] r97865 - /llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
Dale Johannesen
dalej at apple.com
Fri Mar 5 18:45:27 PST 2010
Author: johannes
Date: Fri Mar 5 20:45:26 2010
New Revision: 97865
URL: http://llvm.org/viewvc/llvm-project?rev=97865&view=rev
Log:
Fix another case where LSR was affected by debug info.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp?rev=97865&r1=97864&r2=97865&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolutionExpander.cpp Fri Mar 5 20:45:26 2010
@@ -1267,8 +1267,19 @@
L = L->getParentLoop())
if (S->isLoopInvariant(L)) {
if (!L) break;
- if (BasicBlock *Preheader = L->getLoopPreheader())
+ if (BasicBlock *Preheader = L->getLoopPreheader()) {
InsertPt = Preheader->getTerminator();
+ BasicBlock::iterator IP = InsertPt;
+ // Back past any debug info instructions. Sometimes we inserted
+ // something earlier before debug info but after any real instructions.
+ // This should behave the same as if debug info was not present.
+ while (IP != Preheader->begin()) {
+ --IP;
+ if (!isa<DbgInfoIntrinsic>(IP))
+ break;
+ InsertPt = IP;
+ }
+ }
} else {
// If the SCEV is computable at this level, insert it into the header
// after the PHIs (and after any other instructions that we've inserted
More information about the llvm-commits
mailing list