From: Benjamin Kramer Date: Sun, 17 Nov 2013 10:40:03 +0000 (+0000) Subject: DAGCombiner: Partially revert r192795, getNOT was fixed not to create illegal constants. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=d5ae5b018644345ba0fc48a47030ef1105e1abfd;p=oota-llvm.git DAGCombiner: Partially revert r192795, getNOT was fixed not to create illegal constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194959 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 78543a4113d..15b4ddc0338 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 be2ea525b15..fd8e1b4ceba 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 }