llvm.org GIT mirror llvm / 621e06f
Fix another case where LSR was affected by debug info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97865 91177308-0d34-0410-b5e6-96231b3b80d8 Dale Johannesen 10 years ago
1 changed file(s) with 12 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
12661266 L = L->getParentLoop())
12671267 if (S->isLoopInvariant(L)) {
12681268 if (!L) break;
1269 if (BasicBlock *Preheader = L->getLoopPreheader())
1269 if (BasicBlock *Preheader = L->getLoopPreheader()) {
12701270 InsertPt = Preheader->getTerminator();
1271 BasicBlock::iterator IP = InsertPt;
1272 // Back past any debug info instructions. Sometimes we inserted
1273 // something earlier before debug info but after any real instructions.
1274 // This should behave the same as if debug info was not present.
1275 while (IP != Preheader->begin()) {
1276 --IP;
1277 if (!isa(IP))
1278 break;
1279 InsertPt = IP;
1280 }
1281 }
12711282 } else {
12721283 // If the SCEV is computable at this level, insert it into the header
12731284 // after the PHIs (and after any other instructions that we've inserted