From: Chris Lattner Date: Sat, 16 Oct 2004 18:13:47 +0000 (+0000) Subject: ADd support for undef and unreachable X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=289a49ab7de9eef5d0ede1f07272a4c390174613;p=oota-llvm.git ADd support for undef and unreachable git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17050 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/PPC32ISelSimple.cpp b/lib/Target/PowerPC/PPC32ISelSimple.cpp index fd5f671ac4e..247da627aae 100644 --- a/lib/Target/PowerPC/PPC32ISelSimple.cpp +++ b/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(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(Op1); - ConstantUInt *CUI = dyn_cast(Op1); - if ((CSI && CSI->isAllOnesValue()) || (CUI && CUI->isAllOnesValue())) { + ConstantInt *CI = dyn_cast(Op1); + if (CI && CI->isAllOnesValue()) { BuildMI(*MBB, IP, PPC::NOR, 2, DestReg).addReg(Op0Reg).addReg(Op0Reg); return; }