mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
One more place to skip debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67811 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fafd98b23e
commit
2d69724938
@ -145,10 +145,11 @@ bool CodeGenPrepare::runOnFunction(Function &F) {
|
|||||||
return EverMadeChange;
|
return EverMadeChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// EliminateMostlyEmptyBlocks - eliminate blocks that contain only PHI nodes
|
/// EliminateMostlyEmptyBlocks - eliminate blocks that contain only PHI nodes,
|
||||||
/// and an unconditional branch. Passes before isel (e.g. LSR/loopsimplify)
|
/// debug info directives, and an unconditional branch. Passes before isel
|
||||||
/// often split edges in ways that are non-optimal for isel. Start by
|
/// (e.g. LSR/loopsimplify) often split edges in ways that are non-optimal for
|
||||||
/// eliminating these blocks so we can split them the way we want them.
|
/// isel. Start by eliminating these blocks so we can split them the way we
|
||||||
|
/// want them.
|
||||||
bool CodeGenPrepare::EliminateMostlyEmptyBlocks(Function &F) {
|
bool CodeGenPrepare::EliminateMostlyEmptyBlocks(Function &F) {
|
||||||
bool MadeChange = false;
|
bool MadeChange = false;
|
||||||
// Note that this intentionally skips the entry block.
|
// Note that this intentionally skips the entry block.
|
||||||
@ -160,12 +161,18 @@ bool CodeGenPrepare::EliminateMostlyEmptyBlocks(Function &F) {
|
|||||||
if (!BI || !BI->isUnconditional())
|
if (!BI || !BI->isUnconditional())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If the instruction before the branch isn't a phi node, then other stuff
|
// If the instruction before the branch (skipping debug info) isn't a phi
|
||||||
// is happening here.
|
// node, then other stuff is happening here.
|
||||||
BasicBlock::iterator BBI = BI;
|
BasicBlock::iterator BBI = BI;
|
||||||
if (BBI != BB->begin()) {
|
if (BBI != BB->begin()) {
|
||||||
--BBI;
|
--BBI;
|
||||||
if (!isa<PHINode>(BBI)) continue;
|
while (isa<DbgInfoIntrinsic>(BBI)) {
|
||||||
|
if (BBI == BB->begin())
|
||||||
|
break;
|
||||||
|
--BBI;
|
||||||
|
}
|
||||||
|
if (!isa<DbgInfoIntrinsic>(BBI) && !isa<PHINode>(BBI))
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not break infinite loops.
|
// Do not break infinite loops.
|
||||||
|
Loading…
Reference in New Issue
Block a user