Skip to content

Commit 063d70f

Browse files
committed
[VPlan] Remove ResumePhi opcode, use regular PHI instead (NFC).
Use regular VPPhi instead of a separate opcode for resume phis. This removes an unneeded specialized opcode and unifies the code (verification, printing, updating when CFG is changed). Depends on llvm#140132.
1 parent e90ea09 commit 063d70f

File tree

8 files changed

+54
-75
lines changed

8 files changed

+54
-75
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,8 +2381,8 @@ void InnerLoopVectorizer::introduceCheckBlockInVPlan(BasicBlock *CheckIRBB) {
23812381
// We just connected a new block to the scalar preheader. Update all
23822382
// ResumePhis by adding an incoming value for it, replicating the last value.
23832383
for (VPRecipeBase &R : *cast<VPBasicBlock>(ScalarPH)) {
2384-
auto *ResumePhi = dyn_cast<VPInstruction>(&R);
2385-
if (!ResumePhi || ResumePhi->getOpcode() != VPInstruction::ResumePhi)
2384+
auto *ResumePhi = cast<VPPhi>(&R);
2385+
if (ResumePhi->getNumIncoming() == ScalarPH->getNumPredecessors())
23862386
continue;
23872387
ResumePhi->addOperand(
23882388
ResumePhi->getOperand(ResumePhi->getNumOperands() - 1));
@@ -2533,7 +2533,8 @@ BasicBlock *InnerLoopVectorizer::emitMemRuntimeChecks(BasicBlock *Bypass) {
25332533
static void replaceVPBBWithIRVPBB(VPBasicBlock *VPBB, BasicBlock *IRBB) {
25342534
VPIRBasicBlock *IRVPBB = VPBB->getPlan()->createVPIRBasicBlock(IRBB);
25352535
for (auto &R : make_early_inc_range(*VPBB)) {
2536-
assert(!R.isPhi() && "Tried to move phi recipe to end of block");
2536+
assert((IRVPBB->empty() || IRVPBB->back().isPhi() || !R.isPhi()) &&
2537+
"Tried to move phi recipe to end of block");
25372538
R.moveBefore(*IRVPBB, IRVPBB->end());
25382539
}
25392540

@@ -7591,10 +7592,7 @@ static void fixReductionScalarResumeWhenVectorizingEpilog(
75917592
// created a bc.merge.rdx Phi after the main vector body. Ensure that we carry
75927593
// over the incoming values correctly.
75937594
using namespace VPlanPatternMatch;
7594-
auto IsResumePhi = [](VPUser *U) {
7595-
auto *VPI = dyn_cast<VPInstruction>(U);
7596-
return VPI && VPI->getOpcode() == VPInstruction::ResumePhi;
7597-
};
7595+
auto IsResumePhi = [](VPUser *U) { return isa<VPPhi>(U); };
75987596
assert(count_if(EpiRedResult->users(), IsResumePhi) == 1 &&
75997597
"ResumePhi must have a single user");
76007598
auto *EpiResumePhiVPI =
@@ -8776,9 +8774,8 @@ static VPInstruction *addResumePhiRecipeForInduction(
87768774
WideIV->getDebugLoc());
87778775
}
87788776

8779-
auto *ResumePhiRecipe =
8780-
ScalarPHBuilder.createNaryOp(VPInstruction::ResumePhi, {EndValue, Start},
8781-
WideIV->getDebugLoc(), "bc.resume.val");
8777+
auto *ResumePhiRecipe = ScalarPHBuilder.createScalarPhi(
8778+
{EndValue, Start}, WideIV->getDebugLoc(), "bc.resume.val");
87828779
return ResumePhiRecipe;
87838780
}
87848781

@@ -8807,8 +8804,7 @@ static void addScalarResumePhis(VPRecipeBuilder &Builder, VPlan &Plan,
88078804
if (VPInstruction *ResumePhi = addResumePhiRecipeForInduction(
88088805
WideIVR, VectorPHBuilder, ScalarPHBuilder, TypeInfo,
88098806
&Plan.getVectorTripCount())) {
8810-
assert(ResumePhi->getOpcode() == VPInstruction::ResumePhi &&
8811-
"Expected a ResumePhi");
8807+
assert(isa<VPPhi>(ResumePhi) && "Expected a phi");
88128808
IVEndValues[WideIVR] = ResumePhi->getOperand(0);
88138809
ScalarPhiIRI->addOperand(ResumePhi);
88148810
continue;
@@ -8833,8 +8829,7 @@ static void addScalarResumePhis(VPRecipeBuilder &Builder, VPlan &Plan,
88338829
VPInstruction::ExtractLastElement, {ResumeFromVectorLoop}, {},
88348830
"vector.recur.extract");
88358831
StringRef Name = IsFOR ? "scalar.recur.init" : "bc.merge.rdx";
8836-
auto *ResumePhiR = ScalarPHBuilder.createNaryOp(
8837-
VPInstruction::ResumePhi,
8832+
auto *ResumePhiR = ScalarPHBuilder.createScalarPhi(
88388833
{ResumeFromVectorLoop, VectorPhiR->getStartValue()}, {}, Name);
88398834
ScalarPhiIRI->addOperand(ResumePhiR);
88408835
}
@@ -10010,9 +10005,7 @@ static void preparePlanForMainVectorLoop(VPlan &MainPlan, VPlan &EpiPlan) {
1001010005
VPI->setOperand(1, Freeze);
1001110006
if (UpdateResumePhis)
1001210007
OrigStart->replaceUsesWithIf(Freeze, [Freeze](VPUser &U, unsigned) {
10013-
return Freeze != &U && isa<VPInstruction>(&U) &&
10014-
cast<VPInstruction>(&U)->getOpcode() ==
10015-
VPInstruction::ResumePhi;
10008+
return Freeze != &U && isa<VPPhi>(&U);
1001610009
});
1001710010
}
1001810011
};
@@ -10025,13 +10018,12 @@ static void preparePlanForMainVectorLoop(VPlan &MainPlan, VPlan &EpiPlan) {
1002510018
// scalar (which will become vector) epilogue loop we are done. Otherwise
1002610019
// create it below.
1002710020
if (any_of(*MainScalarPH, [VectorTC](VPRecipeBase &R) {
10028-
return match(&R, m_VPInstruction<VPInstruction::ResumePhi>(
10029-
m_Specific(VectorTC), m_SpecificInt(0)));
10021+
return match(&R, m_VPInstruction<Instruction::PHI>(m_Specific(VectorTC),
10022+
m_SpecificInt(0)));
1003010023
}))
1003110024
return;
1003210025
VPBuilder ScalarPHBuilder(MainScalarPH, MainScalarPH->begin());
10033-
ScalarPHBuilder.createNaryOp(
10034-
VPInstruction::ResumePhi,
10026+
ScalarPHBuilder.createScalarPhi(
1003510027
{VectorTC, MainPlan.getCanonicalIV()->getStartValue()}, {},
1003610028
"vec.epilog.resume.val");
1003710029
}

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -887,11 +887,6 @@ class VPInstruction : public VPRecipeWithIRFlags,
887887
SLPStore,
888888
ActiveLaneMask,
889889
ExplicitVectorLength,
890-
/// Creates a scalar phi in a leaf VPBB with a single predecessor in VPlan.
891-
/// The first operand is the incoming value from the predecessor in VPlan,
892-
/// the second operand is the incoming value for all other predecessors
893-
/// (which are currently not modeled in VPlan).
894-
ResumePhi,
895890
CalculateTripCountMinusVF,
896891
// Increment the canonical IV separately for each unrolled part.
897892
CanonicalIVIncrementForPart,
@@ -1137,11 +1132,15 @@ struct VPPhi : public VPInstruction, public VPPhiAccessors {
11371132
VPPhi(ArrayRef<VPValue *> Operands, DebugLoc DL, const Twine &Name = "")
11381133
: VPInstruction(Instruction::PHI, Operands, DL, Name) {}
11391134

1140-
static inline bool classof(const VPRecipeBase *U) {
1135+
static inline bool classof(const VPUser *U) {
11411136
auto *R = dyn_cast<VPInstruction>(U);
11421137
return R && R->getOpcode() == Instruction::PHI;
11431138
}
11441139

1140+
VPPhi *clone() override {
1141+
return new VPPhi(operands(), getDebugLoc(), getName());
1142+
}
1143+
11451144
void execute(VPTransformState &State) override;
11461145

11471146
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)

llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ Type *VPTypeAnalysis::inferScalarTypeForRecipe(const VPInstruction *R) {
101101
return inferScalarType(R->getOperand(0));
102102
case VPInstruction::FirstOrderRecurrenceSplice:
103103
case VPInstruction::Not:
104-
case VPInstruction::ResumePhi:
105104
case VPInstruction::CalculateTripCountMinusVF:
106105
case VPInstruction::CanonicalIVIncrementForPart:
107106
case VPInstruction::AnyOf:

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -732,17 +732,6 @@ Value *VPInstruction::generate(VPTransformState &State) {
732732
Value *Addend = State.get(getOperand(1), VPLane(0));
733733
return Builder.CreatePtrAdd(Ptr, Addend, Name, getGEPNoWrapFlags());
734734
}
735-
case VPInstruction::ResumePhi: {
736-
auto *NewPhi =
737-
Builder.CreatePHI(State.TypeAnalysis.inferScalarType(this), 2, Name);
738-
for (const auto &[IncVPV, PredVPBB] :
739-
zip(operands(), getParent()->getPredecessors())) {
740-
Value *IncV = State.get(IncVPV, /* IsScalar */ true);
741-
BasicBlock *PredBB = State.CFG.VPBB2IRBB.at(cast<VPBasicBlock>(PredVPBB));
742-
NewPhi->addIncoming(IncV, PredBB);
743-
}
744-
return NewPhi;
745-
}
746735
case VPInstruction::AnyOf: {
747736
Value *A = State.get(getOperand(0));
748737
return Builder.CreateOrReduce(A);
@@ -841,8 +830,7 @@ bool VPInstruction::isVectorToScalar() const {
841830
}
842831

843832
bool VPInstruction::isSingleScalar() const {
844-
return getOpcode() == VPInstruction::ResumePhi ||
845-
getOpcode() == Instruction::PHI;
833+
return getOpcode() == Instruction::PHI;
846834
}
847835

848836
void VPInstruction::execute(VPTransformState &State) {
@@ -928,7 +916,6 @@ bool VPInstruction::onlyFirstLaneUsed(const VPValue *Op) const {
928916
case VPInstruction::CanonicalIVIncrementForPart:
929917
case VPInstruction::BranchOnCount:
930918
case VPInstruction::BranchOnCond:
931-
case VPInstruction::ResumePhi:
932919
return true;
933920
case VPInstruction::PtrAdd:
934921
return Op == getOperand(0) || vputils::onlyFirstLaneUsed(this);
@@ -985,9 +972,6 @@ void VPInstruction::print(raw_ostream &O, const Twine &Indent,
985972
case VPInstruction::ActiveLaneMask:
986973
O << "active lane mask";
987974
break;
988-
case VPInstruction::ResumePhi:
989-
O << "resume-phi";
990-
break;
991975
case VPInstruction::ExplicitVectorLength:
992976
O << "EXPLICIT-VECTOR-LENGTH";
993977
break;
@@ -1095,11 +1079,19 @@ void VPInstructionWithType::print(raw_ostream &O, const Twine &Indent,
10951079

10961080
void VPPhi::execute(VPTransformState &State) {
10971081
State.setDebugLocFrom(getDebugLoc());
1098-
BasicBlock *VectorPH = State.CFG.VPBB2IRBB.at(getIncomingBlock(0));
1099-
Value *Start = State.get(getIncomingValue(0), VPLane(0));
1100-
PHINode *Phi = State.Builder.CreatePHI(Start->getType(), 2, getName());
1101-
Phi->addIncoming(Start, VectorPH);
1102-
State.set(this, Phi, VPLane(0));
1082+
PHINode *NewPhi = State.Builder.CreatePHI(
1083+
State.TypeAnalysis.inferScalarType(this), 2, getName());
1084+
// TODO: Fixup incoming values once other recipes are enabled.
1085+
unsigned NumIncoming =
1086+
getParent() == getParent()->getPlan()->getScalarPreheader()
1087+
? getNumIncoming()
1088+
: 1;
1089+
for (unsigned Idx = 0; Idx != NumIncoming; ++Idx) {
1090+
Value *IncV = State.get(getIncomingValue(Idx), VPLane(0));
1091+
BasicBlock *PredBB = State.CFG.VPBB2IRBB.at(getIncomingBlock(Idx));
1092+
NewPhi->addIncoming(IncV, PredBB);
1093+
}
1094+
State.set(this, NewPhi, VPLane(0));
11031095
}
11041096

11051097
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,8 +1863,8 @@ static void removeBranchOnCondTrue(VPlan &Plan) {
18631863
!isa<PHINode>(cast<VPIRInstruction>(&R)->getInstruction())) &&
18641864
!isa<VPHeaderPHIRecipe>(&R) &&
18651865
"Cannot update VPIRInstructions wrapping phis or header phis yet");
1866-
auto *VPI = dyn_cast<VPInstruction>(&R);
1867-
if (!VPI || VPI->getOpcode() != VPInstruction::ResumePhi)
1866+
auto *VPI = dyn_cast<VPPhi>(&R);
1867+
if (!VPI)
18681868
break;
18691869
VPBuilder B(VPI);
18701870
SmallVector<VPValue *> NewOperands;
@@ -1874,9 +1874,8 @@ static void removeBranchOnCondTrue(VPlan &Plan) {
18741874
continue;
18751875
NewOperands.push_back(Op);
18761876
}
1877-
VPI->replaceAllUsesWith(B.createNaryOp(VPInstruction::ResumePhi,
1878-
NewOperands, VPI->getDebugLoc(),
1879-
VPI->getName()));
1877+
VPI->replaceAllUsesWith(
1878+
B.createScalarPhi(NewOperands, VPI->getDebugLoc(), VPI->getName()));
18801879
VPI->eraseFromParent();
18811880
}
18821881
// Disconnect blocks and remove the terminator. RemovedSucc will be deleted

llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,7 @@ bool VPlanVerifier::verifyVPBasicBlock(const VPBasicBlock *VPBB) {
243243
continue;
244244
}
245245
// TODO: Also verify VPPredInstPHIRecipe.
246-
if (isa<VPPredInstPHIRecipe>(UI) ||
247-
(isa<VPInstruction>(UI) && (cast<VPInstruction>(UI)->getOpcode() ==
248-
VPInstruction::ResumePhi)))
246+
if (isa<VPPredInstPHIRecipe>(UI))
249247
continue;
250248

251249
// If the user is in the same block, check it comes after R in the

llvm/test/Transforms/LoopVectorize/vplan-printing-before-execute.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ define void @test_tc_less_than_16(ptr %A, i64 %N) {
4949
; CHECK-NEXT: No successors
5050
; CHECK-EMPTY:
5151
; CHECK-NEXT: scalar.ph:
52-
; CHECK-NEXT: EMIT vp<[[RESUME1:%.+]]> = resume-phi vp<[[END1]]>, ir<%and>
53-
; CHECK-NEXT: EMIT vp<[[RESUME2:%.+]]>.1 = resume-phi vp<[[END2]]>, ir<%A>
52+
; CHECK-NEXT: EMIT vp<[[RESUME1:%.+]]> = phi [ vp<[[END1]]>, middle.block ], [ ir<%and>, ir-bb<entry> ]
53+
; CHECK-NEXT: EMIT vp<[[RESUME2:%.+]]>.1 = phi [ vp<[[END2]]>, middle.block ], [ ir<%A>, ir-bb<entry> ]
5454
; CHECK-NEXT: Successor(s): ir-bb<loop>
5555
; CHECK-EMPTY:
5656
; CHECK-NEXT: ir-bb<loop>:
@@ -99,8 +99,8 @@ define void @test_tc_less_than_16(ptr %A, i64 %N) {
9999
; CHECK-NEXT: No successors
100100
; CHECK-EMPTY:
101101
; CHECK-NEXT: ir-bb<scalar.ph>:
102-
; CHECK-NEXT: EMIT vp<[[RESUME1:%.+]]> = resume-phi vp<[[END1]]>, ir<%and>
103-
; CHECK-NEXT: EMIT vp<[[RESUME2:%.+]]>.1 = resume-phi vp<[[END2]]>, ir<%A>
102+
; CHECK-NEXT: EMIT vp<[[RESUME1:%.+]]> = phi [ vp<[[END1]]>, middle.block ], [ ir<%and>, ir-bb<entry> ]
103+
; CHECK-NEXT: EMIT vp<[[RESUME2:%.+]]>.1 = phi [ vp<[[END2]]>, middle.block ], [ ir<%A>, ir-bb<entry> ]
104104
; CHECK-NEXT: Successor(s): ir-bb<loop>
105105
; CHECK-EMPTY:
106106
; CHECK-NEXT: ir-bb<loop>:

llvm/test/Transforms/LoopVectorize/vplan-printing.ll

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ define void @print_call_and_memory(i64 %n, ptr noalias %y, ptr noalias %x) nounw
4646
; CHECK-NEXT: No successors
4747
; CHECK-EMPTY:
4848
; CHECK-NEXT: scalar.ph
49-
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = resume-phi vp<[[VTC]]>, ir<0>
49+
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = phi [ vp<[[VTC]]>, middle.block ], [ ir<0>, ir-bb<for.body.preheader> ]
5050
; CHECK-NEXT: Successor(s): ir-bb<for.body>
5151
; CHECK-EMPTY:
5252
; CHECK-NEXT: ir-bb<for.body>:
@@ -117,7 +117,7 @@ define void @print_widen_gep_and_select(i64 %n, ptr noalias %y, ptr noalias %x,
117117
; CHECK-NEXT: No successors
118118
; CHECK-EMPTY:
119119
; CHECK-NEXT: scalar.ph
120-
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = resume-phi vp<[[VTC]]>, ir<0>
120+
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = phi [ vp<[[VTC]]>, middle.block ], [ ir<0>, ir-bb<for.body.preheader> ]
121121
; CHECK-NEXT: Successor(s): ir-bb<for.body>
122122
; CHECK-EMPTY:
123123
; CHECK-NEXT: ir-bb<for.body>:
@@ -206,7 +206,7 @@ define void @print_replicate_predicated_phi(i64 %n, ptr %x) {
206206
; CHECK-NEXT: No successors
207207
; CHECK-EMPTY:
208208
; CHECK-NEXT: scalar.ph
209-
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = resume-phi vp<[[VTC]]>, ir<0>
209+
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = phi [ vp<[[VTC]]>, middle.block ], [ ir<0>, ir-bb<entry> ]
210210
; CHECK-NEXT: Successor(s): ir-bb<for.body>
211211
; CHECK-EMPTY:
212212
; CHECK-NEXT: ir-bb<for.body>:
@@ -289,7 +289,7 @@ define void @print_interleave_groups(i32 %C, i32 %D) {
289289
; CHECK-NEXT: No successors
290290
; CHECK-EMPTY:
291291
; CHECK-NEXT: scalar.ph
292-
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = resume-phi vp<[[IV_END]]>, ir<0>
292+
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = phi [ vp<[[IV_END]]>, middle.block ], [ ir<0>, ir-bb<entry> ]
293293
; CHECK-NEXT: Successor(s): ir-bb<for.body>
294294
; CHECK-EMPTY:
295295
; CHECK-NEXT: ir-bb<for.body>:
@@ -394,7 +394,7 @@ define void @debug_loc_vpinstruction(ptr nocapture %asd, ptr nocapture %bsd) !db
394394
; CHECK-NEXT: No successors
395395
; CHECK-EMPTY:
396396
; CHECK-NEXT: scalar.ph:
397-
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = resume-phi vp<[[VTC]]>, ir<0>
397+
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = phi [ vp<[[VTC]]>, middle.block ], [ ir<0>, ir-bb<entry> ]
398398
; CHECK-NEXT: Successor(s): ir-bb<loop>
399399
; CHECK-EMPTY:
400400
; CHECK-NEXT: ir-bb<loop>:
@@ -479,7 +479,7 @@ define void @print_expand_scev(i64 %y, ptr %ptr) {
479479
; CHECK-NEXT: No successors
480480
; CHECK-EMPTY:
481481
; CHECK-NEXT: scalar.ph
482-
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = resume-phi vp<[[IV_END]]>, ir<0>
482+
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = phi [ vp<[[IV_END]]>, middle.block ], [ ir<0>, ir-bb<entry> ]
483483
; CHECK-NEXT: Successor(s): ir-bb<loop>
484484
; CHECK-EMPTY:
485485
; CHECK-NEXT: ir-bb<loop>:
@@ -548,7 +548,7 @@ define i32 @print_exit_value(ptr %ptr, i32 %off) {
548548
; CHECK-NEXT: No successors
549549
; CHECK-EMPTY:
550550
; CHECK-NEXT: scalar.ph
551-
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = resume-phi vp<[[VTC]]>, ir<0>
551+
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = phi [ vp<[[VTC]]>, middle.block ], [ ir<0>, ir-bb<entry> ]
552552
; CHECK-NEXT: Successor(s): ir-bb<loop>
553553
; CHECK-EMPTY:
554554
; CHECK-NEXT: ir-bb<loop>:
@@ -616,7 +616,7 @@ define void @print_fast_math_flags(i64 %n, ptr noalias %y, ptr noalias %x, ptr %
616616
; CHECK-NEXT: No successors
617617
; CHECK-EMPTY:
618618
; CHECK-NEXT: scalar.ph
619-
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = resume-phi vp<[[VTC]]>, ir<0>
619+
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = phi [ vp<[[VTC]]>, middle.block ], [ ir<0>, ir-bb<entry> ]
620620
; CHECK-NEXT: Successor(s): ir-bb<loop>
621621
; CHECK-EMPTY:
622622
; CHECK-NEXT: ir-bb<loop>:
@@ -686,7 +686,7 @@ define void @print_exact_flags(i64 %n, ptr noalias %x) {
686686
; CHECK-NEXT: No successors
687687
; CHECK-EMPTY:
688688
; CHECK-NEXT: scalar.ph
689-
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = resume-phi vp<[[VTC]]>, ir<0>
689+
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = phi [ vp<[[VTC]]>, middle.block ], [ ir<0>, ir-bb<entry> ]
690690
; CHECK-NEXT: Successor(s): ir-bb<loop>
691691
; CHECK-EMPTY:
692692
; CHECK-NEXT: ir-bb<loop>:
@@ -776,7 +776,7 @@ define void @print_call_flags(ptr readonly %src, ptr noalias %dest, i64 %n) {
776776
; CHECK-NEXT: No successors
777777
; CHECK-EMPTY:
778778
; CHECK-NEXT: scalar.ph
779-
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = resume-phi vp<[[VTC]]>, ir<0>
779+
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = phi [ vp<[[VTC]]>, middle.block ], [ ir<0>, ir-bb<entry> ]
780780
; CHECK-NEXT: Successor(s): ir-bb<for.body>
781781
; CHECK-EMPTY:
782782
; CHECK-NEXT: ir-bb<for.body>:
@@ -855,7 +855,7 @@ define void @print_disjoint_flags(i64 %n, ptr noalias %x) {
855855
; CHECK-NEXT: No successors
856856
; CHECK-EMPTY:
857857
; CHECK-NEXT: scalar.ph
858-
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = resume-phi vp<[[VTC]]>, ir<0>
858+
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = phi [ vp<[[VTC]]>, middle.block ], [ ir<0>, ir-bb<entry> ]
859859
; CHECK-NEXT: Successor(s): ir-bb<loop>
860860
; CHECK-EMPTY:
861861
; CHECK-NEXT: ir-bb<loop>:
@@ -972,8 +972,8 @@ define i16 @print_first_order_recurrence_and_result(ptr %ptr) {
972972
; CHECK-NEXT: No successors
973973
; CHECK-EMPTY:
974974
; CHECK-NEXT: scalar.ph
975-
; CHECK-NEXT: EMIT vp<[[RESUME_P:%.*]]> = resume-phi vp<[[RESUME_1]]>, ir<22>
976-
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = resume-phi vp<[[VTC]]>, ir<0>
975+
; CHECK-NEXT: EMIT vp<[[RESUME_P:%.*]]> = phi [ vp<[[RESUME_1]]>, middle.block ], [ ir<22>, ir-bb<entry> ]
976+
; CHECK-NEXT: EMIT vp<[[RESUME_IV:%.+]]> = phi [ vp<[[VTC]]>, middle.block ], [ ir<0>, ir-bb<entry> ]
977977
; CHECK-NEXT: Successor(s): ir-bb<loop>
978978
; CHECK-EMPTY:
979979
; CHECK-NEXT: ir-bb<loop>:

0 commit comments

Comments
 (0)