summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 322e9be0083..b809bbc1c6c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -5428,6 +5428,10 @@ SDValue DAGCombiner::unfoldMaskedMerge(SDNode *N) {
if (!TLI.hasAndNot(M))
return SDValue();
+ // If Y is a constant, check that 'andn' works with immediates.
+ if (!TLI.hasAndNot(Y))
+ return SDValue();
+
SDLoc DL(N);
SDValue LHS = DAG.getNode(ISD::AND, DL, VT, X, M);
OpenPOWER on IntegriCloud