@@ -22665,47 +22665,6 @@ bool RISCVTargetLowering::lowerDeinterleavedIntrinsicToVPLoad(
2266522665 return true;
2266622666}
2266722667
22668- /// If we're interleaving 2 constant splats, for instance `<vscale x 8 x i32>
22669- /// <splat of 666>` and `<vscale x 8 x i32> <splat of 777>`, we can create a
22670- /// larger splat
22671- /// `<vscale x 4 x i64> <splat of ((777 << 32) | 666)>` first before casting it
22672- /// into
22673- /// `<vscale x 8 x i32>`. This will resuling a simple unit stride store rather
22674- /// than a segment store, which is more expensive in this case.
22675- static Value *foldInterleaved2OfConstSplats(Value *Op0, Value *Op1,
22676- VectorType *VTy,
22677- const TargetLowering *TLI,
22678- Instruction *VPStore) {
22679- auto *SplatVal0 = dyn_cast_or_null<ConstantInt>(getSplatValue(Op0));
22680- auto *SplatVal1 = dyn_cast_or_null<ConstantInt>(getSplatValue(Op1));
22681- if (!SplatVal0 || !SplatVal1)
22682- return nullptr;
22683-
22684- auto &Ctx = VPStore->getContext();
22685- auto &DL = VPStore->getModule()->getDataLayout();
22686-
22687- auto *NewVTy = VectorType::getExtendedElementVectorType(VTy);
22688- if (!TLI->isTypeLegal(TLI->getValueType(DL, NewVTy)))
22689- return nullptr;
22690-
22691- // InterleavedAccessPass will remove VPStore after this but we still want to
22692- // preserve it, hence clone another one here.
22693- auto *ClonedVPStore = VPStore->clone();
22694- ClonedVPStore->insertBefore(VPStore);
22695- IRBuilder<> Builder(ClonedVPStore);
22696-
22697- Type *ETy = VTy->getElementType();
22698- unsigned Width = ETy->getIntegerBitWidth();
22699-
22700- APInt NewSplatVal(Width * 2, SplatVal1->getZExtValue());
22701- NewSplatVal <<= Width;
22702- NewSplatVal |= SplatVal0->getZExtValue();
22703- auto *NewSplat = ConstantVector::getSplat(NewVTy->getElementCount(),
22704- ConstantInt::get(Ctx, NewSplatVal));
22705- return Builder.CreateBitCast(NewSplat,
22706- VectorType::getDoubleElementsVectorType(VTy));
22707- }
22708-
2270922668/// Lower an interleaved vp.store into a vssegN intrinsic.
2271022669///
2271122670/// E.g. Lower an interleaved vp.store (Factor = 2):
@@ -22748,14 +22707,6 @@ bool RISCVTargetLowering::lowerInterleavedIntrinsicToVPStore(
2274822707 Store->getArgOperand(1)->getType()->getPointerAddressSpace(), DL))
2274922708 return false;
2275022709
22751- if (Factor == 2)
22752- if (Value *BC = foldInterleaved2OfConstSplats(
22753- InterleaveOperands[0], InterleaveOperands[1], VTy, this, Store)) {
22754- // Store is guranteed to be the only user of the interleaved intrinsic.
22755- Store->getOperand(0)->replaceAllUsesWith(BC);
22756- return true;
22757- }
22758-
2275922710 IRBuilder<> Builder(Store);
2276022711 Value *WideEVL = Store->getArgOperand(3);
2276122712 // Conservatively check if EVL is a multiple of factor, otherwise some
0 commit comments