File tree Expand file tree Collapse file tree 4 files changed +143
-137
lines changed Expand file tree Collapse file tree 4 files changed +143
-137
lines changed Original file line number Diff line number Diff line change @@ -749,6 +749,18 @@ SDValue TargetLowering::SimplifyMultipleUseDemandedBits(
749749 return Vec;
750750 break ;
751751 }
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+ }
752764 case ISD::VECTOR_SHUFFLE: {
753765 ArrayRef<int > ShuffleMask = cast<ShuffleVectorSDNode>(Op)->getMask ();
754766
You can’t perform that action at this time.
0 commit comments