Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 8b036fe

Browse files
committed
Revert "[DebugInfo][Dexter] Unreachable line stepped onto after SimplifyCFG."
This reverts commit 8381d3e.
1 parent 21a0c9e commit 8b036fe

File tree

4 files changed

+0
-152
lines changed

4 files changed

+0
-152
lines changed

include/llvm/IR/Instruction.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -586,14 +586,6 @@ class Instruction : public User,
586586
static_cast<const Instruction *>(this)->getNextNonDebugInstruction());
587587
}
588588

589-
/// Return a pointer to the previous non-debug instruction in the same basic
590-
/// block as 'this', or nullptr if no such instruction exists.
591-
const Instruction *getPrevNonDebugInstruction() const;
592-
Instruction *getPrevNonDebugInstruction() {
593-
return const_cast<Instruction *>(
594-
static_cast<const Instruction *>(this)->getPrevNonDebugInstruction());
595-
}
596-
597589
/// Create a copy of 'this' instruction that is identical in all ways except
598590
/// the following:
599591
/// * The instruction has no parent

lib/IR/Instruction.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -602,13 +602,6 @@ const Instruction *Instruction::getNextNonDebugInstruction() const {
602602
return nullptr;
603603
}
604604

605-
const Instruction *Instruction::getPrevNonDebugInstruction() const {
606-
for (const Instruction *I = getPrevNode(); I; I = I->getPrevNode())
607-
if (!isa<DbgInfoIntrinsic>(I))
608-
return I;
609-
return nullptr;
610-
}
611-
612605
bool Instruction::isAssociative() const {
613606
unsigned Opcode = getOpcode();
614607
if (isAssociative(Opcode))

lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,14 +1372,6 @@ static bool HoistThenElseCodeToIf(BranchInst *BI,
13721372
}
13731373
}
13741374

1375-
// As the parent basic block terminator is a branch instruction which is
1376-
// removed at the end of the current transformation, use its previous
1377-
// non-debug instruction, as the reference insertion point, which will
1378-
// provide the debug location for the instruction being hoisted. For BBs
1379-
// with only debug instructions, use an empty debug location.
1380-
Instruction *InsertPt =
1381-
BIParent->getTerminator()->getPrevNonDebugInstruction();
1382-
13831375
// Okay, it is safe to hoist the terminator.
13841376
Instruction *NT = I1->clone();
13851377
BIParent->getInstList().insert(BI->getIterator(), NT);
@@ -1389,14 +1381,6 @@ static bool HoistThenElseCodeToIf(BranchInst *BI,
13891381
NT->takeName(I1);
13901382
}
13911383

1392-
// The instruction NT being hoisted, is the terminator for the true branch,
1393-
// with debug location (DILocation) within that branch. We can't retain
1394-
// its original debug location value, otherwise 'select' instructions that
1395-
// are created from any PHI nodes, will take its debug location, giving
1396-
// the impression that those 'select' instructions are in the true branch,
1397-
// causing incorrect stepping, affecting the debug experience.
1398-
NT->setDebugLoc(InsertPt ? InsertPt->getDebugLoc() : DebugLoc());
1399-
14001384
IRBuilder<NoFolder> Builder(NT);
14011385
// Hoisting one of the terminators from our successor is a great thing.
14021386
// Unfortunately, the successors of the if/else blocks may have PHI nodes in

test/CodeGen/X86/pr39187-g.ll

Lines changed: 0 additions & 121 deletions
This file was deleted.

0 commit comments

Comments
 (0)