summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2009-08-08 20:42:17 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2009-08-08 20:42:17 +0000
commitdc6bccbaa6bcd79d661d66f4e76fdc74be3939df (patch)
treebeeb9da35ac2e08acd9c7320ebc8a64d132d3a96 /llvm/lib/CodeGen
parent36d04ec972c16a59fc7f277f74815d8a6bd51e56 (diff)
downloadbcm5719-llvm-dc6bccbaa6bcd79d661d66f4e76fdc74be3939df.tar.gz
bcm5719-llvm-dc6bccbaa6bcd79d661d66f4e76fdc74be3939df.zip
Don't build illegal ops in DAGCombiner::SimplifyBinOpWithSameOpcodeHands().
Blackfin supports and/or/xor on i32 but not on i16. Teach DAGCombiner::SimplifyBinOpWithSameOpcodeHands to not produce illegal nodes after legalize ops. llvm-svn: 78497
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 3d0f337c709..7dec304689b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1679,7 +1679,9 @@ SDValue DAGCombiner::SimplifyBinOpWithSameOpcodeHands(SDNode *N) {
N0.getOpcode() == ISD::SIGN_EXTEND ||
(N0.getOpcode() == ISD::TRUNCATE &&
!TLI.isTruncateFree(N0.getOperand(0).getValueType(), VT))) &&
- N0.getOperand(0).getValueType() == N1.getOperand(0).getValueType()) {
+ N0.getOperand(0).getValueType() == N1.getOperand(0).getValueType() &&
+ (!LegalOperations ||
+ TLI.isOperationLegal(N->getOpcode(), N0.getOperand(0).getValueType()))) {
SDValue ORNode = DAG.getNode(N->getOpcode(), N0.getDebugLoc(),
N0.getOperand(0).getValueType(),
N0.getOperand(0), N1.getOperand(0));
OpenPOWER on IntegriCloud