diff options
| author | Dale Johannesen <dalej@apple.com> | 2010-04-02 01:38:09 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2010-04-02 01:38:09 +0000 |
| commit | 4244d12769ff19cc917ac39ee450a12bbcfeccfb (patch) | |
| tree | a73cbf2711c72627e31eee0ca4e370c63a0a177b /llvm/lib/Target/Alpha | |
| parent | 8d6d0d4c5866268c202389487e49626181a340f1 (diff) | |
| download | bcm5719-llvm-4244d12769ff19cc917ac39ee450a12bbcfeccfb.tar.gz bcm5719-llvm-4244d12769ff19cc917ac39ee450a12bbcfeccfb.zip | |
Teach AnalyzeBranch, RemoveBranch and the branch
folder to be tolerant of debug info following the
branch(es) at the end of a block.
llvm-svn: 100168
Diffstat (limited to 'llvm/lib/Target/Alpha')
| -rw-r--r-- | llvm/lib/Target/Alpha/AlphaInstrInfo.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/Target/Alpha/AlphaInstrInfo.cpp b/llvm/lib/Target/Alpha/AlphaInstrInfo.cpp index 39f0749ec42..d539e082118 100644 --- a/llvm/lib/Target/Alpha/AlphaInstrInfo.cpp +++ b/llvm/lib/Target/Alpha/AlphaInstrInfo.cpp @@ -301,7 +301,15 @@ bool AlphaInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TB bool AllowModify) const { // If the block has no terminators, it just falls into the block after it. MachineBasicBlock::iterator I = MBB.end(); - if (I == MBB.begin() || !isUnpredicatedTerminator(--I)) + if (I == MBB.begin()) + return false; + --I; + while (I->isDebugValue()) { + if (I == MBB.begin()) + return false; + --I; + } + if (!isUnpredicatedTerminator(I)) return false; // Get the last instruction in the block. @@ -362,6 +370,11 @@ unsigned AlphaInstrInfo::RemoveBranch(MachineBasicBlock &MBB) const { MachineBasicBlock::iterator I = MBB.end(); if (I == MBB.begin()) return 0; --I; + while (I->isDebugValue()) { + if (I == MBB.begin()) + return 0; + --I; + } if (I->getOpcode() != Alpha::BR && I->getOpcode() != Alpha::COND_BRANCH_I && I->getOpcode() != Alpha::COND_BRANCH_F) |

