Skip to content

Commit 0b39926

Browse files
committed
!fixup use IsaPred.
1 parent a02b1d5 commit 0b39926

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7534,11 +7534,10 @@ static void fixReductionScalarResumeWhenVectorizingEpilog(
75347534
// created a bc.merge.rdx Phi after the main vector body. Ensure that we carry
75357535
// over the incoming values correctly.
75367536
using namespace VPlanPatternMatch;
7537-
auto IsResumePhi = [](VPUser *U) { return isa<VPPhi>(U); };
7538-
assert(count_if(EpiRedResult->users(), IsResumePhi) == 1 &&
7537+
assert(count_if(EpiRedResult->users(), IsaPred<VPPhi>) == 1 &&
75397538
"ResumePhi must have a single user");
75407539
auto *EpiResumePhiVPI =
7541-
cast<VPInstruction>(*find_if(EpiRedResult->users(), IsResumePhi));
7540+
cast<VPInstruction>(*find_if(EpiRedResult->users(), IsaPred<VPPhi>));
75427541
auto *EpiResumePhi = cast<PHINode>(State.get(EpiResumePhiVPI, true));
75437542
EpiResumePhi->setIncomingValueForBlock(
75447543
BypassBlock, MainResumePhi->getIncomingValueForBlock(BypassBlock));

llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ TEST_F(VPVerifierTest, VPPhiIncomingValueDoesntDominateIncomingBlock) {
151151
VPBasicBlock *VPBB1 = Plan.getEntry();
152152
VPBasicBlock *VPBB2 = Plan.createVPBasicBlock("");
153153
VPBasicBlock *VPBB3 = Plan.createVPBasicBlock("");
154+
VPBasicBlock *VPBB4 = Plan.createVPBasicBlock("");
154155

155156
VPInstruction *DefI = new VPInstruction(Instruction::Add, {Zero});
156157
VPPhi *Phi = new VPPhi({DefI}, {});
@@ -162,6 +163,7 @@ TEST_F(VPVerifierTest, VPPhiIncomingValueDoesntDominateIncomingBlock) {
162163
VPRegionBlock *R1 = Plan.createVPRegionBlock(VPBB3, VPBB3, "R1");
163164
VPBlockUtils::connectBlocks(VPBB1, VPBB2);
164165
VPBlockUtils::connectBlocks(VPBB2, R1);
166+
VPBlockUtils::connectBlocks(VPBB4, Plan.getScalarHeader());
165167
#if GTEST_HAS_STREAM_REDIRECTION
166168
::testing::internal::CaptureStderr();
167169
#endif

0 commit comments

Comments
 (0)