File tree 4 files changed +143
-137
lines changed
4 files changed +143
-137
lines changed Original file line number Diff line number Diff line change @@ -749,6 +749,18 @@ SDValue TargetLowering::SimplifyMultipleUseDemandedBits(
749
749
return Vec;
750
750
break ;
751
751
}
752
+ case ISD::INSERT_SUBVECTOR: {
753
+ // If we don't demand the inserted subvector, return the base vector.
754
+ SDValue Vec = Op.getOperand (0 );
755
+ SDValue Sub = Op.getOperand (1 );
756
+ auto *CIdx = dyn_cast<ConstantSDNode>(Op.getOperand (2 ));
757
+ unsigned NumVecElts = Vec.getValueType ().getVectorNumElements ();
758
+ unsigned NumSubElts = Sub.getValueType ().getVectorNumElements ();
759
+ if (CIdx && CIdx->getAPIntValue ().ule (NumVecElts - NumSubElts))
760
+ if (DemandedElts.extractBits (NumSubElts, CIdx->getZExtValue ()) == 0 )
761
+ return Vec;
762
+ break ;
763
+ }
752
764
case ISD::VECTOR_SHUFFLE: {
753
765
ArrayRef<int > ShuffleMask = cast<ShuffleVectorSDNode>(Op)->getMask ();
754
766
You can’t perform that action at this time.
0 commit comments