@@ -21464,26 +21464,22 @@ bool RISCVTargetLowering::lowerDeinterleaveIntrinsicToLoad(
21464
21464
21465
21465
const unsigned Factor = 2;
21466
21466
21467
- VectorType *VTy = cast<VectorType>(DI->getOperand(0)->getType());
21468
21467
VectorType *ResVTy = cast<VectorType>(DI->getType()->getContainedType(0));
21469
21468
const DataLayout &DL = LI->getDataLayout();
21470
21469
21471
21470
if (!isLegalInterleavedAccessType(ResVTy, Factor, LI->getAlign(),
21472
21471
LI->getPointerAddressSpace(), DL))
21473
21472
return false;
21474
21473
21475
- Function *VlsegNFunc;
21476
- Value *VL, *Return;
21474
+ Value *Return;
21477
21475
Type *XLenTy = Type::getIntNTy(LI->getContext(), Subtarget.getXLen());
21478
- SmallVector<Value *, 10> Ops;
21479
21476
21480
- if (auto *FVTy = dyn_cast<FixedVectorType>(VTy )) {
21481
- VlsegNFunc = Intrinsic::getDeclaration(
21477
+ if (auto *FVTy = dyn_cast<FixedVectorType>(ResVTy )) {
21478
+ Function * VlsegNFunc = Intrinsic::getDeclaration(
21482
21479
LI->getModule(), FixedVlsegIntrIds[Factor - 2],
21483
21480
{ResVTy, LI->getPointerOperandType(), XLenTy});
21484
- VL = ConstantInt::get(XLenTy, FVTy->getNumElements());
21485
- Ops.append({LI->getPointerOperand(), VL});
21486
- Return = Builder.CreateCall(VlsegNFunc, Ops);
21481
+ Value *VL = ConstantInt::get(XLenTy, FVTy->getNumElements());
21482
+ Return = Builder.CreateCall(VlsegNFunc, {LI->getPointerOperand(), VL});
21487
21483
} else {
21488
21484
static const Intrinsic::ID IntrIds[] = {
21489
21485
Intrinsic::riscv_vlseg2, Intrinsic::riscv_vlseg3,
@@ -21499,13 +21495,13 @@ bool RISCVTargetLowering::lowerDeinterleaveIntrinsicToLoad(
21499
21495
NumElts * SEW / 8),
21500
21496
Factor);
21501
21497
21502
- VlsegNFunc = Intrinsic::getDeclaration(LI->getModule(), IntrIds[Factor - 2],
21503
- {VecTupTy, XLenTy});
21504
- VL = Constant::getAllOnesValue(XLenTy);
21498
+ Function * VlsegNFunc = Intrinsic::getDeclaration(
21499
+ LI->getModule(), IntrIds[Factor - 2], {VecTupTy, XLenTy});
21500
+ Value * VL = Constant::getAllOnesValue(XLenTy);
21505
21501
21506
- Ops.append({PoisonValue::get(VecTupTy), LI->getPointerOperand(), VL,
21507
- ConstantInt ::get(XLenTy, Log2_64(SEW))});
21508
- Value *Vlseg = Builder.CreateCall(VlsegNFunc, Ops );
21502
+ Value *Vlseg = Builder.CreateCall(
21503
+ VlsegNFunc, {PoisonValue ::get(VecTupTy), LI->getPointerOperand(), VL,
21504
+ ConstantInt::get(XLenTy, Log2_64(SEW))} );
21509
21505
21510
21506
SmallVector<Type *, 2> AggrTypes{Factor, ResVTy};
21511
21507
Return = PoisonValue::get(StructType::get(LI->getContext(), AggrTypes));
@@ -21535,24 +21531,21 @@ bool RISCVTargetLowering::lowerInterleaveIntrinsicToStore(
21535
21531
21536
21532
const unsigned Factor = 2;
21537
21533
21538
- VectorType *VTy = cast<VectorType>(II->getType());
21539
- VectorType *InVTy = cast<VectorType>(II->getOperand(0)->getType());
21534
+ VectorType *InVTy = cast<VectorType>(II->getArgOperand(0)->getType());
21540
21535
const DataLayout &DL = SI->getDataLayout();
21541
21536
21542
21537
if (!isLegalInterleavedAccessType(InVTy, Factor, SI->getAlign(),
21543
21538
SI->getPointerAddressSpace(), DL))
21544
21539
return false;
21545
21540
21546
- Function *VssegNFunc;
21547
- Value *VL;
21548
21541
Type *XLenTy = Type::getIntNTy(SI->getContext(), Subtarget.getXLen());
21549
21542
21550
- if (auto *FVTy = dyn_cast<FixedVectorType>(VTy )) {
21551
- VssegNFunc = Intrinsic::getDeclaration(
21543
+ if (auto *FVTy = dyn_cast<FixedVectorType>(InVTy )) {
21544
+ Function * VssegNFunc = Intrinsic::getDeclaration(
21552
21545
SI->getModule(), FixedVssegIntrIds[Factor - 2],
21553
21546
{InVTy, SI->getPointerOperandType(), XLenTy});
21554
- VL = ConstantInt::get(XLenTy, FVTy->getNumElements());
21555
- Builder.CreateCall(VssegNFunc, {II->getOperand (0), II->getOperand (1),
21547
+ Value * VL = ConstantInt::get(XLenTy, FVTy->getNumElements());
21548
+ Builder.CreateCall(VssegNFunc, {II->getArgOperand (0), II->getArgOperand (1),
21556
21549
SI->getPointerOperand(), VL});
21557
21550
} else {
21558
21551
static const Intrinsic::ID IntrIds[] = {
@@ -21569,17 +21562,18 @@ bool RISCVTargetLowering::lowerInterleaveIntrinsicToStore(
21569
21562
NumElts * SEW / 8),
21570
21563
Factor);
21571
21564
21572
- VssegNFunc = Intrinsic::getDeclaration(SI->getModule(), IntrIds[Factor - 2],
21573
- {VecTupTy, XLenTy});
21565
+ Function * VssegNFunc = Intrinsic::getDeclaration(
21566
+ SI->getModule(), IntrIds[Factor - 2], {VecTupTy, XLenTy});
21574
21567
21575
- VL = Constant::getAllOnesValue(XLenTy);
21568
+ Value * VL = Constant::getAllOnesValue(XLenTy);
21576
21569
21577
21570
Function *VecInsertFunc = Intrinsic::getDeclaration(
21578
21571
SI->getModule(), Intrinsic::riscv_tuple_insert, {VecTupTy, InVTy});
21579
21572
Value *StoredVal = PoisonValue::get(VecTupTy);
21580
21573
for (unsigned i = 0; i < Factor; ++i)
21581
- StoredVal = Builder.CreateCall(
21582
- VecInsertFunc, {StoredVal, II->getOperand(i), Builder.getInt32(i)});
21574
+ StoredVal =
21575
+ Builder.CreateCall(VecInsertFunc, {StoredVal, II->getArgOperand(i),
21576
+ Builder.getInt32(i)});
21583
21577
21584
21578
Builder.CreateCall(VssegNFunc, {StoredVal, SI->getPointerOperand(), VL,
21585
21579
ConstantInt::get(XLenTy, Log2_64(SEW))});
0 commit comments