summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-07-26 09:41:08 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-07-26 09:41:08 +0000
commit9758407bf100ec9d1d8a1666046e6cb6675207d5 (patch)
tree980ea4c359958e5c7c9b8241402897f1e6b03327 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parentfcdceab7e122b45ae7cb8e9a21308da5bd6121ef (diff)
downloadbcm5719-llvm-9758407bf100ec9d1d8a1666046e6cb6675207d5.tar.gz
bcm5719-llvm-9758407bf100ec9d1d8a1666046e6cb6675207d5.zip
[TargetLowering] SimplifyMultipleUseDemandedBits - add SIGN_EXTEND_INREG support.
llvm-svn: 367096
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 6020877780f..f5e8c4e0ebf 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -666,6 +666,13 @@ SDValue TargetLowering::SimplifyMultipleUseDemandedBits(
return Op.getOperand(1);
break;
}
+ case ISD::SIGN_EXTEND_INREG: {
+ // If none of the extended bits are demanded, eliminate the sextinreg.
+ EVT ExVT = cast<VTSDNode>(Op.getOperand(1))->getVT();
+ if (DemandedBits.getActiveBits() <= ExVT.getScalarSizeInBits())
+ return Op.getOperand(0);
+ break;
+ }
case ISD::VECTOR_SHUFFLE: {
ArrayRef<int> ShuffleMask = cast<ShuffleVectorSDNode>(Op)->getMask();
OpenPOWER on IntegriCloud