summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-10-16 14:16:19 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-10-16 14:16:19 +0000
commit00eb07b7917bd6c7a5a58f5df92eb3b416c860ca (patch)
treed1d7700db5d863517a1c14317477ad03dbee7d24 /llvm/lib/CodeGen/SelectionDAG
parentd3d23bec66de349522544d8d5510ac54d8b95e40 (diff)
downloadbcm5719-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.cpp2
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());
OpenPOWER on IntegriCloud