summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-05-11 20:56:05 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-05-11 20:56:05 +0000
commit605a840747be60e2813137c94ae22d27a2f74564 (patch)
treec66f18fb64b75a990e77a0ea8688ded5bc85bbc7 /llvm/lib/CodeGen/SelectionDAG
parent3fa632a11236a212d4f36c8f0a802ab0aaacb071 (diff)
downloadbcm5719-llvm-605a840747be60e2813137c94ae22d27a2f74564.tar.gz
bcm5719-llvm-605a840747be60e2813137c94ae22d27a2f74564.zip
[DAG] Add SimplifyDemandedBits support for BITREVERSE
Pulled out of D58017 while I continue to investigate the BSWAP regression on PPC llvm-svn: 360534
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 093778add49..502913886e3 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1268,6 +1268,16 @@ bool TargetLowering::SimplifyDemandedBits(
}
break;
}
+ case ISD::BITREVERSE: {
+ SDValue Src = Op.getOperand(0);
+ APInt DemandedSrcBits = DemandedBits.reverseBits();
+ if (SimplifyDemandedBits(Src, DemandedSrcBits, DemandedElts, Known2, TLO,
+ Depth + 1))
+ return true;
+ Known.One = Known2.One.reverseBits();
+ Known.Zero = Known2.Zero.reverseBits();
+ break;
+ }
case ISD::SIGN_EXTEND_INREG: {
SDValue Op0 = Op.getOperand(0);
EVT ExVT = cast<VTSDNode>(Op.getOperand(1))->getVT();
OpenPOWER on IntegriCloud