instructions take a consistent reg class. Implement ISD::UNDEF in the dag->dag
selector to generate this, fixing UnitTests/2003-07-06-IntOverflow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23028
91177308-0d34-0410-b5e6-
96231b3b80d8
// minor pessimization that saves us from having to worry about
// keeping the offsets up to date later when we emit long branch glue.
return 12;
- case PPC::IMPLICIT_DEF: // no asm emitted
+ case PPC::IMPLICIT_DEF_GPR: // no asm emitted
+ case PPC::IMPLICIT_DEF_FP: // no asm emitted
return 0;
default:
break;
default:
emitWord(getBinaryCodeForInstr(*I));
break;
- case PPC::IMPLICIT_DEF:
+ case PPC::IMPLICIT_DEF_GPR:
+ case PPC::IMPLICIT_DEF_FP:
break; // pseudo opcode, no side effects
case PPC::MovePCtoLR:
assert(0 && "CodeEmitter does not support MovePCtoLR instruction");
std::cerr << "\n";
abort();
case ISD::EntryToken: // These leaves remain the same.
- case ISD::UNDEF:
return Op;
case ISD::TokenFactor: {
SDOperand New;
}
break;
}
+ case ISD::UNDEF:
+ if (N->getValueType(0) == MVT::i32)
+ CurDAG->SelectNodeTo(N, MVT::i32, PPC::IMPLICIT_DEF_GPR);
+ else
+ CurDAG->SelectNodeTo(N, N->getValueType(0), PPC::IMPLICIT_DEF_FP);
+ break;
case ISD::GlobalAddress: {
GlobalValue *GV = cast<GlobalAddressSDNode>(N)->getGlobal();
SDOperand Tmp;
Node->dump(); std::cerr << '\n';
assert(0 && "Node not handled!\n");
case ISD::UNDEF:
- BuildMI(BB, PPC::IMPLICIT_DEF, 0, Result);
+ if (Node->getValueType(0) == MVT::i32)
+ BuildMI(BB, PPC::IMPLICIT_DEF_GPR, 0, Result);
+ else
+ BuildMI(BB, PPC::IMPLICIT_DEF_FP, 0, Result);
return Result;
case ISD::DYNAMIC_STACKALLOC:
// Generate both result values. FIXME: Need a better commment here?
return;
case ISD::ImplicitDef:
Select(N.getOperand(0));
- BuildMI(BB, PPC::IMPLICIT_DEF, 0,
- cast<RegisterSDNode>(N.getOperand(1))->getReg());
+ Tmp1 = cast<RegisterSDNode>(N.getOperand(1))->getReg();
+ if (N.getOperand(1).getValueType() == MVT::i32)
+ BuildMI(BB, PPC::IMPLICIT_DEF_GPR, 0, Tmp1);
+ else
+ BuildMI(BB, PPC::IMPLICIT_DEF_FP, 0, Tmp1);
return;
case ISD::RET:
switch (N.getNumOperands()) {
def ADJCALLSTACKDOWN : Pseudo<(ops u16imm), "; ADJCALLSTACKDOWN">;
def ADJCALLSTACKUP : Pseudo<(ops u16imm), "; ADJCALLSTACKUP">;
}
-def IMPLICIT_DEF : Pseudo<(ops variable_ops), "; IMPLICIT_DEF">;
+def IMPLICIT_DEF_GPR : Pseudo<(ops GPRC:$rD), "; $rD = IMPLICIT_DEF_GPRC">;
+def IMPLICIT_DEF_FP : Pseudo<(ops FPRC:$rD), "; %rD = IMPLICIT_DEF_FP">;
let Defs = [LR] in
def MovePCtoLR : Pseudo<(ops piclabel:$label), "bl $label">;