Skip to content

Commit a65c9c3

Browse files
committed
[VPlan] Use VPInstructionWithType for uniform casts.
Use VPInstructionWithType instead of VPReplicate recipe for uniform casts. This is a first step towards breaking up VPReplicateRecipe. Using the general VPInstructionWithType has the additional benefit that we can now apply a number of simplifications directly. This patch also adds a new IsSingleScalar field to VPInstruction, to encode the fact we know a recipe always produces a single scalar.
1 parent 9ea4924 commit a65c9c3

16 files changed

+88
-63
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8343,7 +8343,7 @@ VPRecipeBuilder::tryToWidenHistogram(const HistogramInfo *HI,
83438343
return new VPHistogramRecipe(Opcode, HGramOps, HI->Store->getDebugLoc());
83448344
}
83458345

8346-
VPReplicateRecipe *
8346+
VPSingleDefRecipe *
83478347
VPRecipeBuilder::handleReplication(Instruction *I, ArrayRef<VPValue *> Operands,
83488348
VFRange &Range) {
83498349
bool IsUniform = LoopVectorizationPlanner::getDecisionAndClampRange(
@@ -8401,6 +8401,13 @@ VPRecipeBuilder::handleReplication(Instruction *I, ArrayRef<VPValue *> Operands,
84018401
assert((Range.Start.isScalar() || !IsUniform || !IsPredicated ||
84028402
(Range.Start.isScalable() && isa<IntrinsicInst>(I))) &&
84038403
"Should not predicate a uniform recipe");
8404+
if (IsUniform && Instruction::isCast(I->getOpcode())) {
8405+
auto *Recipe = new VPInstructionWithType(I->getOpcode(), Operands,
8406+
I->getType(), VPIRFlags(*I),
8407+
I->getDebugLoc(), I->getName());
8408+
Recipe->setUnderlyingValue(I);
8409+
return Recipe;
8410+
}
84048411
auto *Recipe = new VPReplicateRecipe(I, Operands, IsUniform, BlockInMask,
84058412
VPIRMetadata(*I, LVer));
84068413
return Recipe;

llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class VPRecipeBuilder {
199199
/// Build a VPReplicationRecipe for \p I using \p Operands. If it is
200200
/// predicated, add the mask as last operand. Range.End may be decreased to
201201
/// ensure same recipe behavior from \p Range.Start to \p Range.End.
202-
VPReplicateRecipe *handleReplication(Instruction *I,
202+
VPSingleDefRecipe *handleReplication(Instruction *I,
203203
ArrayRef<VPValue *> Operands,
204204
VFRange &Range);
205205

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,9 @@ class VPInstruction : public VPRecipeWithIRFlags,
876876
public VPUnrollPartAccessor<1> {
877877
friend class VPlanSlp;
878878

879+
/// True if the VPInstruction produces a single scalar value.
880+
bool IsSingleScalar;
881+
879882
public:
880883
/// VPlan opcodes, extending LLVM IR with idiomatics instructions.
881884
enum {
@@ -966,7 +969,7 @@ class VPInstruction : public VPRecipeWithIRFlags,
966969

967970
VPInstruction(unsigned Opcode, ArrayRef<VPValue *> Operands,
968971
const VPIRFlags &Flags, DebugLoc DL = {},
969-
const Twine &Name = "");
972+
const Twine &Name = "", bool IsSingleScalar = false);
970973

971974
VP_CLASSOF_IMPL(VPDef::VPInstructionSC)
972975

@@ -1054,7 +1057,8 @@ class VPInstructionWithType : public VPInstruction {
10541057
VPInstructionWithType(unsigned Opcode, ArrayRef<VPValue *> Operands,
10551058
Type *ResultTy, const VPIRFlags &Flags, DebugLoc DL,
10561059
const Twine &Name = "")
1057-
: VPInstruction(Opcode, Operands, Flags, DL, Name), ResultTy(ResultTy) {}
1060+
: VPInstruction(Opcode, Operands, Flags, DL, Name, true),
1061+
ResultTy(ResultTy) {}
10581062

10591063
static inline bool classof(const VPRecipeBase *R) {
10601064
// VPInstructionWithType are VPInstructions with specific opcodes requiring
@@ -1090,10 +1094,7 @@ class VPInstructionWithType : public VPInstruction {
10901094

10911095
/// Return the cost of this VPInstruction.
10921096
InstructionCost computeCost(ElementCount VF,
1093-
VPCostContext &Ctx) const override {
1094-
// TODO: Compute accurate cost after retiring the legacy cost model.
1095-
return 0;
1096-
}
1097+
VPCostContext &Ctx) const override;
10971098

10981099
Type *getResultType() const { return ResultTy; }
10991100

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,9 @@ template class VPUnrollPartAccessor<3>;
408408

409409
VPInstruction::VPInstruction(unsigned Opcode, ArrayRef<VPValue *> Operands,
410410
const VPIRFlags &Flags, DebugLoc DL,
411-
const Twine &Name)
411+
const Twine &Name, bool IsSingleScalar)
412412
: VPRecipeWithIRFlags(VPDef::VPInstructionSC, Operands, Flags, DL),
413-
Opcode(Opcode), Name(Name.str()) {
413+
IsSingleScalar(IsSingleScalar), Opcode(Opcode), Name(Name.str()) {
414414
assert(flagsValidForOpcode(getOpcode()) &&
415415
"Set flags not supported for the provided opcode");
416416
}
@@ -847,7 +847,8 @@ bool VPInstruction::isVectorToScalar() const {
847847
}
848848

849849
bool VPInstruction::isSingleScalar() const {
850-
return getOpcode() == VPInstruction::ResumePhi ||
850+
// TODO: Set IsSingleScalar for ResumePhi and PHI.
851+
return IsSingleScalar || getOpcode() == VPInstruction::ResumePhi ||
851852
getOpcode() == Instruction::PHI;
852853
}
853854

@@ -1055,15 +1056,17 @@ void VPInstruction::print(raw_ostream &O, const Twine &Indent,
10551056

10561057
void VPInstructionWithType::execute(VPTransformState &State) {
10571058
State.setDebugLocFrom(getDebugLoc());
1058-
switch (getOpcode()) {
1059-
case Instruction::ZExt:
1060-
case Instruction::Trunc: {
1059+
if (Instruction::isCast(getOpcode())) {
10611060
Value *Op = State.get(getOperand(0), VPLane(0));
10621061
Value *Cast = State.Builder.CreateCast(Instruction::CastOps(getOpcode()),
10631062
Op, ResultTy);
1063+
if (auto *I = dyn_cast<Instruction>(Cast))
1064+
applyFlags(*I);
10641065
State.set(this, Cast, VPLane(0));
1065-
break;
1066+
return;
10661067
}
1068+
1069+
switch (getOpcode()) {
10671070
case VPInstruction::StepVector: {
10681071
Value *StepVector =
10691072
State.Builder.CreateStepVector(VectorType::get(ResultTy, State.VF));
@@ -1075,10 +1078,19 @@ void VPInstructionWithType::execute(VPTransformState &State) {
10751078
}
10761079
}
10771080

1081+
InstructionCost VPInstructionWithType::computeCost(ElementCount VF,
1082+
VPCostContext &Ctx) const {
1083+
// TODO: Compute cost for VPInstructions without underlying values once
1084+
// the legacy cost model has been retired.
1085+
if (!getUnderlyingValue())
1086+
return 0;
1087+
return Ctx.getLegacyCost(cast<Instruction>(getUnderlyingValue()), VF);
1088+
}
1089+
10781090
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
10791091
void VPInstructionWithType::print(raw_ostream &O, const Twine &Indent,
10801092
VPSlotTracker &SlotTracker) const {
1081-
O << Indent << "EMIT ";
1093+
O << Indent << (isSingleScalar() ? "SINGLE-SCALAR " : "EMIT ");
10821094
printAsOperand(O, SlotTracker);
10831095
O << " = ";
10841096

@@ -1604,11 +1616,12 @@ bool VPIRFlags::flagsValidForOpcode(unsigned Opcode) const {
16041616
return Opcode == Instruction::FAdd || Opcode == Instruction::FMul ||
16051617
Opcode == Instruction::FSub || Opcode == Instruction::FNeg ||
16061618
Opcode == Instruction::FDiv || Opcode == Instruction::FRem ||
1619+
Opcode == Instruction::FPTrunc || Opcode == Instruction::FPExt ||
16071620
Opcode == Instruction::FCmp || Opcode == Instruction::Select ||
16081621
Opcode == VPInstruction::WideIVStep ||
16091622
Opcode == VPInstruction::ComputeReductionResult;
16101623
case OperationType::NonNegOp:
1611-
return Opcode == Instruction::ZExt;
1624+
return Opcode == Instruction::UIToFP || Opcode == Instruction::ZExt;
16121625
break;
16131626
case OperationType::Cmp:
16141627
return Opcode == Instruction::ICmp;

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,8 +1048,14 @@ static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
10481048
unsigned ExtOpcode = match(R.getOperand(0), m_SExt(m_VPValue()))
10491049
? Instruction::SExt
10501050
: Instruction::ZExt;
1051-
auto *VPC =
1052-
new VPWidenCastRecipe(Instruction::CastOps(ExtOpcode), A, TruncTy);
1051+
VPSingleDefRecipe *VPC;
1052+
if (vputils::isSingleScalar(R.getVPSingleValue()))
1053+
VPC = new VPInstructionWithType(Instruction::CastOps(ExtOpcode), {A},
1054+
TruncTy, {}, {});
1055+
else
1056+
VPC = new VPWidenCastRecipe(Instruction::CastOps(ExtOpcode), A,
1057+
TruncTy);
1058+
10531059
if (auto *UnderlyingExt = R.getOperand(0)->getUnderlyingValue()) {
10541060
// UnderlyingExt has distinct return type, used to retain legacy cost.
10551061
VPC->setUnderlyingValue(UnderlyingExt);

llvm/test/Transforms/LoopVectorize/AArch64/sve2-histcnt-vplan.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ target triple = "aarch64-unknown-linux-gnu"
2929
; CHECK-NEXT: [[STEPS:vp.*]] = SCALAR-STEPS [[IV]], ir<1>, [[VF]]
3030
; CHECK-NEXT: CLONE [[GEP_IDX:.*]] = getelementptr inbounds ir<%indices>, [[STEPS]]
3131
; CHECK-NEXT: CLONE [[IDX:.*]] = load [[GEP_IDX]]
32-
; CHECK-NEXT: CLONE [[EXT_IDX:.*]] = zext [[IDX]]
32+
; CHECK-NEXT: SINGLE-SCALAR [[EXT_IDX:.*]] = zext [[IDX]]
3333
; CHECK-NEXT: CLONE [[GEP_BUCKET:.*]] = getelementptr inbounds ir<%buckets>, [[EXT_IDX]]
3434
; CHECK-NEXT: CLONE [[HISTVAL:.*]] = load [[GEP_BUCKET]]
3535
; CHECK-NEXT: CLONE [[UPDATE:.*]] = add nsw [[HISTVAL]], ir<1>

llvm/test/Transforms/LoopVectorize/RISCV/riscv-vector-reverse.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ define void @vector_reverse_i64(ptr nocapture noundef writeonly %A, ptr nocaptur
7575
; CHECK-NEXT: vp<[[DEV_IV:%.+]]> = DERIVED-IV ir<%n> + vp<[[CAN_IV]]> * ir<-1>
7676
; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[DEV_IV]]>, ir<-1>
7777
; CHECK-NEXT: CLONE ir<%i.0> = add nsw vp<[[STEPS]]>, ir<-1>
78-
; CHECK-NEXT: CLONE ir<%idxprom> = zext ir<%i.0>
78+
; CHECK-NEXT: SINGLE-SCALAR ir<%idxprom> = zext ir<%i.0>
7979
; CHECK-NEXT: CLONE ir<%arrayidx> = getelementptr inbounds ir<%B>, ir<%idxprom>
8080
; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-end-pointer inbounds ir<%arrayidx>, vp<[[VF]]>
8181
; CHECK-NEXT: WIDEN ir<%1> = load vp<[[VEC_PTR]]>
@@ -199,7 +199,7 @@ define void @vector_reverse_i64(ptr nocapture noundef writeonly %A, ptr nocaptur
199199
; CHECK-NEXT: EMIT-SCALAR vp<[[CAN_IV:%.+]]> = phi [ ir<0>, ir-bb<vector.ph> ], [ vp<[[CAN_IV_NEXT:%.+]]>, vector.body ]
200200
; CHECK-NEXT: vp<[[DEV_IV:%.+]]> = DERIVED-IV ir<%n> + vp<[[CAN_IV]]> * ir<-1>
201201
; CHECK-NEXT: CLONE ir<%i.0> = add nsw vp<[[DEV_IV]]>, ir<-1>
202-
; CHECK-NEXT: CLONE ir<%idxprom> = zext ir<%i.0>
202+
; CHECK-NEXT: SINGLE-SCALAR ir<%idxprom> = zext ir<%i.0>
203203
; CHECK-NEXT: CLONE ir<%arrayidx> = getelementptr inbounds ir<%B>, ir<%idxprom>
204204
; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-end-pointer inbounds ir<%arrayidx>, ir<[[VF]]>
205205
; CHECK-NEXT: WIDEN ir<[[L:%.+]]> = load vp<[[VEC_PTR]]>
@@ -323,7 +323,7 @@ define void @vector_reverse_f32(ptr nocapture noundef writeonly %A, ptr nocaptur
323323
; CHECK-NEXT: vp<[[DEV_IV:%.+]]> = DERIVED-IV ir<%n> + vp<[[CAN_IV]]> * ir<-1>
324324
; CHECK-NEXT: vp<[[STEPS:%.+]]> = SCALAR-STEPS vp<[[DEV_IV]]>, ir<-1>
325325
; CHECK-NEXT: CLONE ir<%i.0> = add nsw vp<[[STEPS]]>, ir<-1>
326-
; CHECK-NEXT: CLONE ir<%idxprom> = zext ir<%i.0>
326+
; CHECK-NEXT: SINGLE-SCALAR ir<%idxprom> = zext ir<%i.0>
327327
; CHECK-NEXT: CLONE ir<%arrayidx> = getelementptr inbounds ir<%B>, ir<%idxprom>
328328
; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-end-pointer inbounds ir<%arrayidx>, vp<[[VF]]>
329329
; CHECK-NEXT: WIDEN ir<%1> = load vp<[[VEC_PTR]]>
@@ -447,7 +447,7 @@ define void @vector_reverse_f32(ptr nocapture noundef writeonly %A, ptr nocaptur
447447
; CHECK-NEXT: EMIT-SCALAR vp<[[CAN_IV:%.+]]> = phi [ ir<0>, ir-bb<vector.ph> ], [ vp<[[CAN_IV_NEXT:%.+]]>, vector.body ]
448448
; CHECK-NEXT: vp<[[DEV_IV:%.+]]> = DERIVED-IV ir<%n> + vp<[[CAN_IV]]> * ir<-1>
449449
; CHECK-NEXT: CLONE ir<%i.0> = add nsw vp<[[DEV_IV]]>, ir<-1>
450-
; CHECK-NEXT: CLONE ir<%idxprom> = zext ir<%i.0>
450+
; CHECK-NEXT: SINGLE-SCALAR ir<%idxprom> = zext ir<%i.0>
451451
; CHECK-NEXT: CLONE ir<%arrayidx> = getelementptr inbounds ir<%B>, ir<%idxprom>
452452
; CHECK-NEXT: vp<[[VEC_PTR:%.+]]> = vector-end-pointer inbounds ir<%arrayidx>, ir<[[VF]]>
453453
; CHECK-NEXT: WIDEN ir<[[L:%.+]]> = load vp<[[VEC_PTR]]>

llvm/test/Transforms/LoopVectorize/RISCV/vplan-vp-call-intrinsics.ll

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ define void @vp_smax(ptr %a, ptr %b, ptr %c, i64 %N) {
3535
; IF-EVL-NEXT: CLONE ir<[[GEP3:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>
3636
; IF-EVL-NEXT: vp<[[PTR3:%[0-9]+]]> = vector-pointer ir<[[GEP3]]>
3737
; IF-EVL-NEXT: WIDEN vp.store vp<[[PTR3]]>, ir<[[SMAX]]>, vp<[[EVL]]>
38-
; IF-EVL-NEXT: EMIT vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
38+
; IF-EVL-NEXT: SINGLE-SCALAR vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
3939
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT]]> = add vp<[[CAST]]>, vp<[[EVL_PHI]]>
4040
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT_EXIT:%.+]]> = add vp<[[IV]]>, vp<[[VFUF]]>
4141
; IF-EVL-NEXT: EMIT branch-on-count vp<[[IV_NEXT_EXIT]]>, vp<[[VTC]]>
@@ -92,7 +92,7 @@ define void @vp_smin(ptr %a, ptr %b, ptr %c, i64 %N) {
9292
; IF-EVL-NEXT: CLONE ir<[[GEP3:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>
9393
; IF-EVL-NEXT: vp<[[PTR3:%[0-9]+]]> = vector-pointer ir<[[GEP3]]>
9494
; IF-EVL-NEXT: WIDEN vp.store vp<[[PTR3]]>, ir<[[SMIN]]>, vp<[[EVL]]>
95-
; IF-EVL-NEXT: EMIT vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
95+
; IF-EVL-NEXT: SINGLE-SCALAR vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
9696
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT]]> = add vp<[[CAST]]>, vp<[[EVL_PHI]]>
9797
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT_EXIT:%.+]]> = add vp<[[IV]]>, vp<[[VFUF]]>
9898
; IF-EVL-NEXT: EMIT branch-on-count vp<[[IV_NEXT_EXIT]]>, vp<[[VTC]]>
@@ -149,7 +149,7 @@ define void @vp_umax(ptr %a, ptr %b, ptr %c, i64 %N) {
149149
; IF-EVL-NEXT: CLONE ir<[[GEP3:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>
150150
; IF-EVL-NEXT: vp<[[PTR3:%[0-9]+]]> = vector-pointer ir<[[GEP3]]>
151151
; IF-EVL-NEXT: WIDEN vp.store vp<[[PTR3]]>, ir<[[UMAX]]>, vp<[[EVL]]>
152-
; IF-EVL-NEXT: EMIT vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
152+
; IF-EVL-NEXT: SINGLE-SCALAR vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
153153
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT]]> = add vp<[[CAST]]>, vp<[[EVL_PHI]]>
154154
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT_EXIT:%.+]]> = add vp<[[IV]]>, vp<[[VFUF]]>
155155
; IF-EVL-NEXT: EMIT branch-on-count vp<[[IV_NEXT_EXIT]]>, vp<[[VTC]]>
@@ -206,7 +206,7 @@ define void @vp_umin(ptr %a, ptr %b, ptr %c, i64 %N) {
206206
; IF-EVL-NEXT: CLONE ir<[[GEP3:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>
207207
; IF-EVL-NEXT: vp<[[PTR3:%[0-9]+]]> = vector-pointer ir<[[GEP3]]>
208208
; IF-EVL-NEXT: WIDEN vp.store vp<[[PTR3]]>, ir<[[UMIN]]>, vp<[[EVL]]>
209-
; IF-EVL-NEXT: EMIT vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
209+
; IF-EVL-NEXT: SINGLE-SCALAR vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
210210
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT]]> = add vp<[[CAST]]>, vp<[[EVL_PHI]]>
211211
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT_EXIT:%.+]]> = add vp<[[IV]]>, vp<[[VFUF]]>
212212
; IF-EVL-NEXT: EMIT branch-on-count vp<[[IV_NEXT_EXIT]]>, vp<[[VTC]]>
@@ -260,7 +260,7 @@ define void @vp_ctlz(ptr %a, ptr %b, i64 %N) {
260260
; IF-EVL-NEXT: CLONE ir<[[GEP2:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>
261261
; IF-EVL-NEXT: vp<[[PTR2:%[0-9]+]]> = vector-pointer ir<[[GEP2]]>
262262
; IF-EVL-NEXT: WIDEN vp.store vp<[[PTR2]]>, ir<[[CTLZ]]>, vp<[[EVL]]>
263-
; IF-EVL-NEXT: EMIT vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
263+
; IF-EVL-NEXT: SINGLE-SCALAR vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
264264
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT]]> = add vp<[[CAST]]>, vp<[[EVL_PHI]]>
265265
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT_EXIT:%.+]]> = add vp<[[IV]]>, vp<[[VFUF]]>
266266
; IF-EVL-NEXT: EMIT branch-on-count vp<[[IV_NEXT_EXIT]]>, vp<[[VTC]]>
@@ -312,7 +312,7 @@ define void @vp_cttz(ptr %a, ptr %b, i64 %N) {
312312
; IF-EVL-NEXT: CLONE ir<[[GEP2:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>
313313
; IF-EVL-NEXT: vp<[[PTR2:%[0-9]+]]> = vector-pointer ir<[[GEP2]]>
314314
; IF-EVL-NEXT: WIDEN vp.store vp<[[PTR2]]>, ir<[[CTTZ]]>, vp<[[EVL]]>
315-
; IF-EVL-NEXT: EMIT vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
315+
; IF-EVL-NEXT: SINGLE-SCALAR vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
316316
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT]]> = add vp<[[CAST]]>, vp<[[EVL_PHI]]>
317317
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT_EXIT:%.+]]> = add vp<[[IV]]>, vp<[[VFUF]]>
318318
; IF-EVL-NEXT: EMIT branch-on-count vp<[[IV_NEXT_EXIT]]>, vp<[[VTC]]>
@@ -366,7 +366,7 @@ define void @vp_lrint(ptr %a, ptr %b, i64 %N) {
366366
; IF-EVL-NEXT: CLONE ir<[[GEP2:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>
367367
; IF-EVL-NEXT: vp<[[PTR2:%[0-9]+]]> = vector-pointer ir<[[GEP2]]>
368368
; IF-EVL-NEXT: WIDEN vp.store vp<[[PTR2]]>, ir<[[TRUNC]]>, vp<[[EVL]]>
369-
; IF-EVL-NEXT: EMIT vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
369+
; IF-EVL-NEXT: SINGLE-SCALAR vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
370370
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT]]> = add vp<[[CAST]]>, vp<[[EVL_PHI]]>
371371
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT_EXIT:%.+]]> = add vp<[[IV]]>, vp<[[VFUF]]>
372372
; IF-EVL-NEXT: EMIT branch-on-count vp<[[IV_NEXT_EXIT]]>, vp<[[VTC]]>
@@ -422,7 +422,7 @@ define void @vp_llrint(ptr %a, ptr %b, i64 %N) {
422422
; IF-EVL-NEXT: CLONE ir<[[GEP2:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>
423423
; IF-EVL-NEXT: vp<[[PTR2:%[0-9]+]]> = vector-pointer ir<[[GEP2]]>
424424
; IF-EVL-NEXT: WIDEN vp.store vp<[[PTR2]]>, ir<[[TRUNC]]>, vp<[[EVL]]>
425-
; IF-EVL-NEXT: EMIT vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
425+
; IF-EVL-NEXT: SINGLE-SCALAR vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
426426
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT]]> = add vp<[[CAST]]>, vp<[[EVL_PHI]]>
427427
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT_EXIT:%.+]]> = add vp<[[IV]]>, vp<[[VFUF]]>
428428
; IF-EVL-NEXT: EMIT branch-on-count vp<[[IV_NEXT_EXIT]]>, vp<[[VTC]]>
@@ -476,7 +476,7 @@ define void @vp_abs(ptr %a, ptr %b, i64 %N) {
476476
; IF-EVL-NEXT: CLONE ir<[[GEP2:%.+]]> = getelementptr inbounds ir<%a>, vp<[[ST]]>
477477
; IF-EVL-NEXT: vp<[[PTR2:%[0-9]+]]> = vector-pointer ir<[[GEP2]]>
478478
; IF-EVL-NEXT: WIDEN vp.store vp<[[PTR2]]>, ir<[[ABS]]>, vp<[[EVL]]>
479-
; IF-EVL-NEXT: EMIT vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
479+
; IF-EVL-NEXT: SINGLE-SCALAR vp<[[CAST:%[0-9]+]]> = zext vp<[[EVL]]> to i64
480480
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT]]> = add vp<[[CAST]]>, vp<[[EVL_PHI]]>
481481
; IF-EVL-NEXT: EMIT vp<[[IV_NEXT_EXIT:%.+]]> = add vp<[[IV]]>, vp<[[VFUF]]>
482482
; IF-EVL-NEXT: EMIT branch-on-count vp<[[IV_NEXT_EXIT]]>, vp<[[VTC]]>

0 commit comments

Comments
 (0)