diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-02-09 07:14:22 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-02-09 07:14:22 +0000 |
commit | 64dfcacd5fb03908ad2432973975ebb1d3eff11f (patch) | |
tree | a65b8ff7aae06eaaecfa02a7ace3f35c833d67e5 /llvm/lib/Target/CellSPU/SPUInstrInfo.cpp | |
parent | 6e91f6119a5a306446f8296fd286fe15dba0fb5a (diff) | |
download | bcm5719-llvm-64dfcacd5fb03908ad2432973975ebb1d3eff11f.tar.gz bcm5719-llvm-64dfcacd5fb03908ad2432973975ebb1d3eff11f.zip |
Turns out AnalyzeBranch can modify the mbb being analyzed. This is a nasty
suprise to some callers, e.g. register coalescer. For now, add an parameter
that tells AnalyzeBranch whether it's safe to modify the mbb. A better
solution is out there, but I don't have time to deal with it right now.
llvm-svn: 64124
Diffstat (limited to 'llvm/lib/Target/CellSPU/SPUInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/CellSPU/SPUInstrInfo.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/CellSPU/SPUInstrInfo.cpp b/llvm/lib/Target/CellSPU/SPUInstrInfo.cpp index 559f095e7a6..ded83247610 100644 --- a/llvm/lib/Target/CellSPU/SPUInstrInfo.cpp +++ b/llvm/lib/Target/CellSPU/SPUInstrInfo.cpp @@ -524,7 +524,8 @@ SPUInstrInfo::foldMemoryOperandImpl(MachineFunction &MF, bool SPUInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, - SmallVectorImpl<MachineOperand> &Cond) const { + SmallVectorImpl<MachineOperand> &Cond, + 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)) @@ -575,7 +576,8 @@ SPUInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, if (isUncondBranch(SecondLastInst) && isUncondBranch(LastInst)) { TBB = SecondLastInst->getOperand(0).getMBB(); I = LastInst; - I->eraseFromParent(); + if (AllowModify) + I->eraseFromParent(); return false; } |