[VPlan] Deref VPlanPtr when passing to transform (NFC) (#161369)
For uniformity with other transforms.
This commit is contained in:
parent
224a7176dc
commit
ff4aec5d3c
@ -8694,7 +8694,7 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlan(VFRange &Range) {
|
||||
Plan->addVF(VF);
|
||||
|
||||
if (!VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(
|
||||
Plan,
|
||||
*Plan,
|
||||
[this](PHINode *P) {
|
||||
return Legal->getIntOrFpInductionDescriptor(P);
|
||||
},
|
||||
|
||||
@ -45,13 +45,13 @@ static cl::opt<bool> EnableWideActiveLaneMask(
|
||||
cl::desc("Enable use of wide get active lane mask instructions"));
|
||||
|
||||
bool VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(
|
||||
VPlanPtr &Plan,
|
||||
VPlan &Plan,
|
||||
function_ref<const InductionDescriptor *(PHINode *)>
|
||||
GetIntOrFpInductionDescriptor,
|
||||
const TargetLibraryInfo &TLI) {
|
||||
|
||||
ReversePostOrderTraversal<VPBlockDeepTraversalWrapper<VPBlockBase *>> RPOT(
|
||||
Plan->getVectorLoopRegion());
|
||||
Plan.getVectorLoopRegion());
|
||||
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(RPOT)) {
|
||||
// Skip blocks outside region
|
||||
if (!VPBB->getParent())
|
||||
@ -77,11 +77,11 @@ bool VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(
|
||||
for (VPValue *Op : PhiR->operands())
|
||||
NewRecipe->addOperand(Op);
|
||||
} else {
|
||||
VPValue *Start = Plan->getOrAddLiveIn(II->getStartValue());
|
||||
VPValue *Start = Plan.getOrAddLiveIn(II->getStartValue());
|
||||
VPValue *Step =
|
||||
vputils::getOrCreateVPValueForSCEVExpr(*Plan, II->getStep());
|
||||
vputils::getOrCreateVPValueForSCEVExpr(Plan, II->getStep());
|
||||
NewRecipe = new VPWidenIntOrFpInductionRecipe(
|
||||
Phi, Start, Step, &Plan->getVF(), *II, Ingredient.getDebugLoc());
|
||||
Phi, Start, Step, &Plan.getVF(), *II, Ingredient.getDebugLoc());
|
||||
}
|
||||
} else {
|
||||
assert(isa<VPInstruction>(&Ingredient) &&
|
||||
|
||||
@ -138,7 +138,7 @@ struct VPlanTransforms {
|
||||
/// widen recipes. Returns false if any VPInstructions could not be converted
|
||||
/// to a wide recipe if needed.
|
||||
LLVM_ABI_FOR_TEST static bool tryToConvertVPInstructionsToVPRecipes(
|
||||
VPlanPtr &Plan,
|
||||
VPlan &Plan,
|
||||
function_ref<const InductionDescriptor *(PHINode *)>
|
||||
GetIntOrFpInductionDescriptor,
|
||||
const TargetLibraryInfo &TLI);
|
||||
|
||||
@ -203,7 +203,7 @@ TEST_F(VPlanHCFGTest, testVPInstructionToVPRecipesInner) {
|
||||
VPInstruction::BranchOnCond,
|
||||
{Plan->getOrAddLiveIn(ConstantInt::getTrue(F->getContext()))}));
|
||||
VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(
|
||||
Plan, [](PHINode *P) { return nullptr; }, TLI);
|
||||
*Plan, [](PHINode *P) { return nullptr; }, TLI);
|
||||
|
||||
VPBlockBase *Entry = Plan->getEntry()->getEntryBasicBlock();
|
||||
EXPECT_EQ(0u, Entry->getNumPredecessors());
|
||||
|
||||
@ -48,7 +48,7 @@ TEST_F(VPUncountableExitTest, FindUncountableExitRecipes) {
|
||||
BasicBlock *LoopHeader = F->getEntryBlock().getSingleSuccessor();
|
||||
auto Plan = buildVPlan(LoopHeader, /*HasUncountableExit=*/true);
|
||||
VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(
|
||||
Plan, [](PHINode *P) { return nullptr; }, *TLI);
|
||||
*Plan, [](PHINode *P) { return nullptr; }, *TLI);
|
||||
VPlanTransforms::runPass(VPlanTransforms::optimize, *Plan);
|
||||
|
||||
SmallVector<VPRecipeBase *> Recipes;
|
||||
@ -85,7 +85,7 @@ TEST_F(VPUncountableExitTest, NoUncountableExit) {
|
||||
BasicBlock *LoopHeader = F->getEntryBlock().getSingleSuccessor();
|
||||
auto Plan = buildVPlan(LoopHeader);
|
||||
VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(
|
||||
Plan, [](PHINode *P) { return nullptr; }, *TLI);
|
||||
*Plan, [](PHINode *P) { return nullptr; }, *TLI);
|
||||
VPlanTransforms::runPass(VPlanTransforms::optimize, *Plan);
|
||||
|
||||
SmallVector<VPRecipeBase *> Recipes;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user