diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2010-05-01 12:04:32 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2010-05-01 12:04:32 +0000 |
commit | ebbdfef2fc7234a5b0ef01295a7d05a7b56ba2ec (patch) | |
tree | e341c422009224022f4b31dd35f22990244e22e0 /llvm/lib/Target/MSP430/MSP430InstrInfo.cpp | |
parent | 6fbff448932b7e1861a135b441e1ecc777adf990 (diff) | |
download | bcm5719-llvm-ebbdfef2fc7234a5b0ef01295a7d05a7b56ba2ec.tar.gz bcm5719-llvm-ebbdfef2fc7234a5b0ef01295a7d05a7b56ba2ec.zip |
Implement indirect branches on MSP430
llvm-svn: 102835
Diffstat (limited to 'llvm/lib/Target/MSP430/MSP430InstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/MSP430/MSP430InstrInfo.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp b/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp index 24ce403ddc7..2b09b3d5268 100644 --- a/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp +++ b/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp @@ -176,7 +176,9 @@ unsigned MSP430InstrInfo::RemoveBranch(MachineBasicBlock &MBB) const { if (I->isDebugValue()) continue; if (I->getOpcode() != MSP430::JMP && - I->getOpcode() != MSP430::JCC) + I->getOpcode() != MSP430::JCC && + I->getOpcode() != MSP430::Br && + I->getOpcode() != MSP430::Bm) break; // Remove the branch. I->eraseFromParent(); @@ -256,6 +258,11 @@ bool MSP430InstrInfo::AnalyzeBranch(MachineBasicBlock &MBB, if (!I->getDesc().isBranch()) return true; + // Cannot handle indirect branches. + if (I->getOpcode() == MSP430::Br || + I->getOpcode() == MSP430::Bm) + return true; + // Handle unconditional branches. if (I->getOpcode() == MSP430::JMP) { if (!AllowModify) { |