summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-08 17:29:49 +0000
committerChris Lattner <sabre@nondot.org>2006-05-08 17:29:49 +0000
commit78da6792e76e8e712a77b391b1e1adf85501596f (patch)
treeae7134d55c44fe37e176124b31a34865bafc925b /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent10c653744ed8a60e29af3895beb55b264bff2e94 (diff)
downloadbcm5719-llvm-78da6792e76e8e712a77b391b1e1adf85501596f.tar.gz
bcm5719-llvm-78da6792e76e8e712a77b391b1e1adf85501596f.zip
Fold shifts with undef operands.
llvm-svn: 28167
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 60a749df2f7..ca123f497e5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1439,11 +1439,14 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
case ISD::FSUB:
case ISD::FDIV:
case ISD::FREM:
+ case ISD::SRA:
return N1; // fold op(undef, arg2) -> undef
case ISD::UDIV:
case ISD::SDIV:
case ISD::UREM:
case ISD::SREM:
+ case ISD::SRL:
+ case ISD::SHL:
return getConstant(0, VT); // fold op(undef, arg2) -> 0
}
}
@@ -1467,9 +1470,13 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
return N2; // fold op(arg1, undef) -> undef
case ISD::MUL:
case ISD::AND:
+ case ISD::SRL:
+ case ISD::SHL:
return getConstant(0, VT); // fold op(arg1, undef) -> 0
case ISD::OR:
return getConstant(MVT::getIntVTBitMask(VT), VT);
+ case ISD::SRA:
+ return N1;
}
}
OpenPOWER on IntegriCloud