diff options
author | Sam Parker <sam.parker@arm.com> | 2017-03-14 09:13:22 +0000 |
---|---|---|
committer | Sam Parker <sam.parker@arm.com> | 2017-03-14 09:13:22 +0000 |
commit | 916b1ba617dbc692d67286f82fa2b19d67c3c167 (patch) | |
tree | aafd455c596a0c76f78d6cedaf1f2310c92fcecc /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | fe34c5e4296d1125a2703f440f417f054b910163 (diff) | |
download | bcm5719-llvm-916b1ba617dbc692d67286f82fa2b19d67c3c167.tar.gz bcm5719-llvm-916b1ba617dbc692d67286f82fa2b19d67c3c167.zip |
[ARM] Move SMULW[B|T] isel to DAG Combine
Create nodes for smulwb and smulwt and move their selection from
DAGToDAG to DAG combine. smlawb and smlawt can then be selected
using tablegen. Added some helper functions to detect shift patterns
as well as a wrapper around SimplifyDemandBits. Added a couple of
extra tests.
Differential Revision: https://reviews.llvm.org/D30708
llvm-svn: 297716
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index b1bfd47eb02..549e3def4ee 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -471,6 +471,21 @@ TargetLowering::TargetLoweringOpt::SimplifyDemandedBits(SDNode *User, return true; } +bool TargetLowering::SimplifyDemandedBits(SDValue Op, APInt &DemandedMask, + DAGCombinerInfo &DCI) const { + + SelectionDAG &DAG = DCI.DAG; + TargetLoweringOpt TLO(DAG, !DCI.isBeforeLegalize(), + !DCI.isBeforeLegalizeOps()); + APInt KnownZero, KnownOne; + + bool Simplified = SimplifyDemandedBits(Op, DemandedMask, KnownZero, KnownOne, + TLO); + if (Simplified) + DCI.CommitTargetLoweringOpt(TLO); + return Simplified; +} + /// Look at Op. At this point, we know that only the DemandedMask bits of the /// result of Op are ever used downstream. If we can use this information to /// simplify Op, create a new simplified DAG node and return true, returning the |