aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp2
-rw-r--r--test/CodeGen/X86/xor.ll2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 78543a4113..15b4ddc033 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -3576,7 +3576,7 @@ SDValue DAGCombiner::visitXOR(SDNode *N) {
}
// fold (xor (and x, y), y) -> (and (not x), y)
if (N0.getOpcode() == ISD::AND && N0.getNode()->hasOneUse() &&
- N0->getOperand(1) == N1 && isTypeLegal(VT.getScalarType())) {
+ N0->getOperand(1) == N1) {
SDValue X = N0->getOperand(0);
SDValue NotX = DAG.getNOT(SDLoc(X), X, VT);
AddToWorkList(NotX.getNode());
diff --git a/test/CodeGen/X86/xor.ll b/test/CodeGen/X86/xor.ll
index be2ea525b1..fd8e1b4ceb 100644
--- a/test/CodeGen/X86/xor.ll
+++ b/test/CodeGen/X86/xor.ll
@@ -178,4 +178,6 @@ define i32 @PR17487(i1 %tobool) {
; X64-LABEL: PR17487:
; X64: andn
+; X32-LABEL: PR17487:
+; X32: andn
}