summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-10-28 07:11:07 +0000
committerChris Lattner <sabre@nondot.org>2008-10-28 07:11:07 +0000
commit5fa104013001fd32b5753b32c9eba33d9c9229d9 (patch)
tree812096fe061e73759a9d04f686cf4f5752a918a2 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent56d016ab05f13033d173a6093535843b02ece0e7 (diff)
downloadbcm5719-llvm-5fa104013001fd32b5753b32c9eba33d9c9229d9.tar.gz
bcm5719-llvm-5fa104013001fd32b5753b32c9eba33d9c9229d9.zip
Don't produce invalid comparisons after legalize.
llvm-svn: 58320
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 0622c552d5a..c6c8e0359b3 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -1720,7 +1720,8 @@ SDValue DAGCombiner::visitAND(SDNode *N) {
if (LL == RL && LR == RR) {
bool isInteger = LL.getValueType().isInteger();
ISD::CondCode Result = ISD::getSetCCAndOperation(Op0, Op1, isInteger);
- if (Result != ISD::SETCC_INVALID)
+ if (Result != ISD::SETCC_INVALID &&
+ (!AfterLegalize || TLI.isCondCodeLegal(Result, LL.getValueType())))
return DAG.getSetCC(N0.getValueType(), LL, LR, Result);
}
}
@@ -1904,7 +1905,8 @@ SDValue DAGCombiner::visitOR(SDNode *N) {
if (LL == RL && LR == RR) {
bool isInteger = LL.getValueType().isInteger();
ISD::CondCode Result = ISD::getSetCCOrOperation(Op0, Op1, isInteger);
- if (Result != ISD::SETCC_INVALID)
+ if (Result != ISD::SETCC_INVALID &&
+ (!AfterLegalize || TLI.isCondCodeLegal(Result, LL.getValueType())))
return DAG.getSetCC(N0.getValueType(), LL, LR, Result);
}
}
OpenPOWER on IntegriCloud