summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-16 18:13:47 +0000
committerChris Lattner <sabre@nondot.org>2004-10-16 18:13:47 +0000
commita3f3c8a1adb8c98ea38b942846a31ac7ed341273 (patch)
tree948d625b02db31fef849d65bd6d5aee171a35aef /llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
parente4bea062c72bd6222b2e0de47df35d28b9f15b99 (diff)
downloadbcm5719-llvm-a3f3c8a1adb8c98ea38b942846a31ac7ed341273.tar.gz
bcm5719-llvm-a3f3c8a1adb8c98ea38b942846a31ac7ed341273.zip
ADd support for undef and unreachable
llvm-svn: 17050
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp b/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
index fd5f671ac4e..247da627aae 100644
--- a/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
+++ b/llvm/lib/Target/PowerPC/PPC32ISelSimple.cpp
@@ -237,9 +237,10 @@ namespace {
// Visitation methods for various instructions. These methods simply emit
// fixed PowerPC code for each instruction.
- // Control flow operators
+ // Control flow operators.
void visitReturnInst(ReturnInst &RI);
void visitBranchInst(BranchInst &BI);
+ void visitUnreachableInst(UnreachableInst &UI) {}
struct ValueRecord {
Value *Val;
@@ -575,6 +576,10 @@ void PPC32ISel::copyGlobalBaseToRegister(MachineBasicBlock *MBB,
void PPC32ISel::copyConstantToRegister(MachineBasicBlock *MBB,
MachineBasicBlock::iterator IP,
Constant *C, unsigned R) {
+ if (isa<UndefValue>(C)) {
+ BuildMI(*MBB, IP, PPC::IMPLICIT_DEF, 0, R);
+ return;
+ }
if (C->getType()->isIntegral()) {
unsigned Class = getClassB(C->getType());
@@ -2117,9 +2122,8 @@ void PPC32ISel::emitBinaryConstOperation(MachineBasicBlock *MBB,
// xor X, -1 -> not X
if (Opcode == 4) {
- ConstantSInt *CSI = dyn_cast<ConstantSInt>(Op1);
- ConstantUInt *CUI = dyn_cast<ConstantUInt>(Op1);
- if ((CSI && CSI->isAllOnesValue()) || (CUI && CUI->isAllOnesValue())) {
+ ConstantInt *CI = dyn_cast<ConstantSInt>(Op1);
+ if (CI && CI->isAllOnesValue()) {
BuildMI(*MBB, IP, PPC::NOR, 2, DestReg).addReg(Op0Reg).addReg(Op0Reg);
return;
}
OpenPOWER on IntegriCloud