mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-19 02:25:01 +00:00
Don't back past debug info intrinsics; SCEVExpander's strategy
for ignoring debug info intrinsics everywhere else is to advance past them, and it needs to be consistent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99332 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1268,19 +1268,8 @@ Value *SCEVExpander::expand(const SCEV *S) {
|
|||||||
L = L->getParentLoop())
|
L = L->getParentLoop())
|
||||||
if (S->isLoopInvariant(L)) {
|
if (S->isLoopInvariant(L)) {
|
||||||
if (!L) break;
|
if (!L) break;
|
||||||
if (BasicBlock *Preheader = L->getLoopPreheader()) {
|
if (BasicBlock *Preheader = L->getLoopPreheader())
|
||||||
InsertPt = Preheader->getTerminator();
|
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 {
|
} else {
|
||||||
// If the SCEV is computable at this level, insert it into the header
|
// 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
|
// after the PHIs (and after any other instructions that we've inserted
|
||||||
|
Reference in New Issue
Block a user