diff options
author | Nate Begeman <natebegeman@mac.com> | 2005-08-18 05:44:50 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2005-08-18 05:44:50 +0000 |
commit | cfb9a74c2ef06f1040d17eadd98b108097f4f4c3 (patch) | |
tree | 8441cc8605c78a3563189b1670408a398206851d /llvm/lib | |
parent | 72d6f8800dbc23b734382438b8e7d9a7540cd229 (diff) | |
download | bcm5719-llvm-cfb9a74c2ef06f1040d17eadd98b108097f4f4c3.tar.gz bcm5719-llvm-cfb9a74c2ef06f1040d17eadd98b108097f4f4c3.zip |
Maintain consistency in negating things
llvm-svn: 22855
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp index 179888d7835..fdeb99eb55e 100644 --- a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp @@ -352,19 +352,18 @@ SDOperand PPC32DAGToDAGISel::Select(SDOperand Op) { // 'not', then fold 'or' into 'nor', and so forth for the supported ops. if (isOprNot(N)) { unsigned Opc; - switch(N->getOperand(0).getOpcode()) { + SDOperand Val = Select(N->getOperand(0)); + switch (Val.getTargetOpcode()) { default: Opc = 0; break; - case ISD::OR: Opc = PPC::NOR; break; - case ISD::AND: Opc = PPC::NAND; break; - case ISD::XOR: Opc = PPC::EQV; break; + case PPC::OR: Opc = PPC::NOR; break; + case PPC::AND: Opc = PPC::NAND; break; + case PPC::XOR: Opc = PPC::EQV; break; } if (Opc) - CurDAG->SelectNodeTo(N, MVT::i32, Opc, - Select(N->getOperand(0).getOperand(0)), - Select(N->getOperand(0).getOperand(1))); + CurDAG->SelectNodeTo(N, MVT::i32, Opc, Val.getOperand(0), + Val.getOperand(1)); else - CurDAG->SelectNodeTo(N, MVT::i32, PPC::NOR, Select(N->getOperand(0)), - Select(N->getOperand(0))); + CurDAG->SelectNodeTo(N, MVT::i32, PPC::NOR, Val, Val); break; } // If this is a xor with an immediate other than -1, then codegen it as high |