diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-10-16 14:16:19 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-10-16 14:16:19 +0000 |
commit | 72a3ee742296aa68fda0118d0e1fa649be756938 (patch) | |
tree | fc567bd5984b78fd0a03772ea7af2c051e6c52f9 /lib | |
parent | 3386d252579ea00d0fc26a3ba7874bec25ce4516 (diff) | |
download | external_llvm-72a3ee742296aa68fda0118d0e1fa649be756938.zip external_llvm-72a3ee742296aa68fda0118d0e1fa649be756938.tar.gz external_llvm-72a3ee742296aa68fda0118d0e1fa649be756938.tar.bz2 |
DAGCombiner: Don't fold xor into not if getNOT would introduce an illegal constant.
This happens e.g. with <2 x i64> -1 on x86_32. It cannot be generated directly
because i64 is illegal. It would be nice if getNOT would handle this
transparently, but I don't see a way to generate a legal constant there right
now. Fixes PR17487.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192795 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 8d6eab7..23e33d4 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -3583,7 +3583,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) { + N0->getOperand(1) == N1 && isTypeLegal(VT.getScalarType())) { SDValue X = N0->getOperand(0); SDValue NotX = DAG.getNOT(SDLoc(X), X, VT); AddToWorkList(NotX.getNode()); |