[llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.h ARMInstrInfo.cpp
Evan Cheng
evan.cheng at apple.com
Wed May 16 14:53:27 PDT 2007
Changes in directory llvm/lib/Target/ARM:
ARMInstrInfo.h updated: 1.9 -> 1.10
ARMInstrInfo.cpp updated: 1.26 -> 1.27
---
Log message:
PredicateInstruction returns true if the operation was successful.
---
Diffs of the changes: (+8 -4)
ARMInstrInfo.cpp | 10 +++++++---
ARMInstrInfo.h | 2 +-
2 files changed, 8 insertions(+), 4 deletions(-)
Index: llvm/lib/Target/ARM/ARMInstrInfo.h
diff -u llvm/lib/Target/ARM/ARMInstrInfo.h:1.9 llvm/lib/Target/ARM/ARMInstrInfo.h:1.10
--- llvm/lib/Target/ARM/ARMInstrInfo.h:1.9 Wed May 16 15:50:23 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.h Wed May 16 16:53:07 2007
@@ -104,7 +104,7 @@
virtual bool ReverseBranchCondition(std::vector<MachineOperand> &Cond) const;
// Predication support.
- virtual void PredicateInstruction(MachineInstr *MI,
+ virtual bool PredicateInstruction(MachineInstr *MI,
std::vector<MachineOperand> &Cond) const;
};
Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp
diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.26 llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.27
--- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.26 Wed May 16 15:50:23 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.cpp Wed May 16 16:53:07 2007
@@ -423,17 +423,21 @@
return false;
}
-void ARMInstrInfo::PredicateInstruction(MachineInstr *MI,
+bool ARMInstrInfo::PredicateInstruction(MachineInstr *MI,
std::vector<MachineOperand> &Cond) const {
unsigned Opc = MI->getOpcode();
if (Opc == ARM::B || Opc == ARM::tB) {
MI->setInstrDescriptor(get(Opc == ARM::B ? ARM::Bcc : ARM::tBcc));
MI->addImmOperand(Cond[0].getImmedValue());
- return;
+ return true;
}
MachineOperand *PMO = MI->findFirstPredOperand();
- PMO->setImm(Cond[0].getImmedValue());
+ if (PMO) {
+ PMO->setImm(Cond[0].getImmedValue());
+ return true;
+ }
+ return false;
}
More information about the llvm-commits
mailing list