summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-02-08 17:19:01 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-02-08 17:19:01 +0000
commit478bb90779863e4faadc37eacd2c101b5cdf3b78 (patch)
tree5fd31d02ce7c3c93df165e151b5c754e23d46d3f /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent91c32fd8c8fa395971a028f7091273fa2c8f44e6 (diff)
downloadbcm5719-llvm-478bb90779863e4faadc37eacd2c101b5cdf3b78.tar.gz
bcm5719-llvm-478bb90779863e4faadc37eacd2c101b5cdf3b78.zip
[TargetLowering] Add SimplifyDemandedBits funnel shift support
llvm-svn: 353539
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-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 5a933dd8be2..b462aabad2f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -7144,6 +7144,10 @@ SDValue DAGCombiner::visitFunnelShift(SDNode *N) {
if (N0 == N1 && hasOperation(RotOpc, VT))
return DAG.getNode(RotOpc, SDLoc(N), VT, N0, N2);
+ // Simplify, based on bits shifted out of N0/N1.
+ if (SimplifyDemandedBits(SDValue(N, 0)))
+ return SDValue(N, 0);
+
return SDValue();
}
OpenPOWER on IntegriCloud