summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2017-05-10 12:34:27 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2017-05-10 12:34:27 +0000
commitc29af824bff54622ee15364d30048c1a7c8d4715 (patch)
treec25a528c601f0516f578c13ee5a09f075a91602e /llvm/lib/CodeGen
parentf3bd8ddedb7f5641d16b15af8b7b327ae5cbf10b (diff)
downloadbcm5719-llvm-c29af824bff54622ee15364d30048c1a7c8d4715.tar.gz
bcm5719-llvm-c29af824bff54622ee15364d30048c1a7c8d4715.zip
[DAGCombiner] Add vector support to fold (shl/srl 0, x) -> 0
llvm-svn: 302641
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 14b7adfea62..2436a81259f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -5331,7 +5331,7 @@ SDValue DAGCombiner::visitSHL(SDNode *N) {
if (N0C && N1C && !N1C->isOpaque())
return DAG.FoldConstantArithmetic(ISD::SHL, SDLoc(N), VT, N0C, N1C);
// fold (shl 0, x) -> 0
- if (isNullConstant(N0))
+ if (isNullConstantOrNullSplatConstant(N0))
return N0;
// fold (shl x, c >= size(x)) -> undef
if (N1C && N1C->getAPIntValue().uge(OpSizeInBits))
@@ -5714,7 +5714,7 @@ SDValue DAGCombiner::visitSRL(SDNode *N) {
if (N0C && N1C && !N1C->isOpaque())
return DAG.FoldConstantArithmetic(ISD::SRL, SDLoc(N), VT, N0C, N1C);
// fold (srl 0, x) -> 0
- if (isNullConstant(N0))
+ if (isNullConstantOrNullSplatConstant(N0))
return N0;
// fold (srl x, c >= size(x)) -> undef
if (N1C && N1C->getAPIntValue().uge(OpSizeInBits))
OpenPOWER on IntegriCloud