diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-06-15 21:15:00 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-06-15 21:15:00 +0000 |
commit | 36b1f5476e51bd5ec94391670bb2bfedfc9576ed (patch) | |
tree | 528c7dd6c4ea8e16185b556fce4897bbf68a0369 /llvm/lib/Target/ARM/ARMInstrInfo.cpp | |
parent | 297d43be007adc922e6d38725ef71ccfb0e7ea9b (diff) | |
download | bcm5719-llvm-36b1f5476e51bd5ec94391670bb2bfedfc9576ed.tar.gz bcm5719-llvm-36b1f5476e51bd5ec94391670bb2bfedfc9576ed.zip |
Instructions with unique labels or embedded jumptables cannot be duplicated during ifcvt.
llvm-svn: 37606
Diffstat (limited to 'llvm/lib/Target/ARM/ARMInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMInstrInfo.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMInstrInfo.cpp b/llvm/lib/Target/ARM/ARMInstrInfo.cpp index 1370faba4d7..c8f7919eabe 100644 --- a/llvm/lib/Target/ARM/ARMInstrInfo.cpp +++ b/llvm/lib/Target/ARM/ARMInstrInfo.cpp @@ -446,6 +446,35 @@ bool ARMInstrInfo::isPredicated(const MachineInstr *MI) const { return PIdx != -1 && MI->getOperand(PIdx).getImmedValue() != ARMCC::AL; } +bool ARMInstrInfo::CanBeDuplicated(const MachineInstr *MI) const { + switch (MI->getOpcode()) { + default: return true; + // These have unique labels. + case ARM::PICADD: + case ARM::PICLD: + case ARM::PICLDZH: + case ARM::PICLDZB: + case ARM::PICLDH: + case ARM::PICLDB: + case ARM::PICLDSH: + case ARM::PICLDSB: + case ARM::PICSTR: + case ARM::PICSTRH: + case ARM::PICSTRB: + case ARM::LEApcrel: + case ARM::LEApcrelJT: + case ARM::tPICADD: + case ARM::tLEApcrel: + case ARM::tLEApcrelJT: + case ARM::CONSTPOOL_ENTRY: + // These embed jumptables. + case ARM::BR_JTr: + case ARM::BR_JTm: + case ARM::BR_JTadd: + return false; + } +} + bool ARMInstrInfo::PredicateInstruction(MachineInstr *MI, const std::vector<MachineOperand> &Pred) const { unsigned Opc = MI->getOpcode(); |