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 | 00eb07b7917bd6c7a5a58f5df92eb3b416c860ca (patch) | |
tree | d1d7700db5d863517a1c14317477ad03dbee7d24 /llvm/lib/CodeGen/SelectionDAG | |
parent | d3d23bec66de349522544d8d5510ac54d8b95e40 (diff) | |
download | bcm5719-llvm-00eb07b7917bd6c7a5a58f5df92eb3b416c860ca.tar.gz bcm5719-llvm-00eb07b7917bd6c7a5a58f5df92eb3b416c860ca.zip |
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.
llvm-svn: 192795
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 8d6eab7c7b9..23e33d4ed22 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/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()); |