[VPlan] Simplify code in single scalar transform code (NFC).
Adjust code as suggested post-commit3b7b95f78e.3b7b95f78e (r160997427)
This commit is contained in:
@@ -1220,9 +1220,9 @@ static void narrowToSingleScalarRecipes(VPlan &Plan) {
|
||||
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
|
||||
vp_depth_first_shallow(Plan.getVectorLoopRegion()->getEntry()))) {
|
||||
for (VPRecipeBase &R : make_early_inc_range(reverse(*VPBB))) {
|
||||
auto *RepR = dyn_cast<VPReplicateRecipe>(&R);
|
||||
if (!RepR && !isa<VPWidenRecipe, VPWidenSelectRecipe>(&R))
|
||||
if (!isa<VPWidenRecipe, VPWidenSelectRecipe, VPReplicateRecipe>(&R))
|
||||
continue;
|
||||
auto *RepR = dyn_cast<VPReplicateRecipe>(&R);
|
||||
if (RepR && (RepR->isSingleScalar() || RepR->isPredicated()))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -69,14 +69,13 @@ inline bool isSingleScalar(const VPValue *VPV) {
|
||||
return Rep->isSingleScalar() || (PreservesUniformity(Rep->getOpcode()) &&
|
||||
all_of(Rep->operands(), isSingleScalar));
|
||||
}
|
||||
if (isa<VPWidenGEPRecipe, VPDerivedIVRecipe, VPBlendRecipe>(VPV))
|
||||
if (isa<VPWidenGEPRecipe, VPDerivedIVRecipe, VPBlendRecipe,
|
||||
VPWidenSelectRecipe>(VPV))
|
||||
return all_of(VPV->getDefiningRecipe()->operands(), isSingleScalar);
|
||||
if (auto *WidenR = dyn_cast<VPWidenRecipe>(VPV)) {
|
||||
return PreservesUniformity(WidenR->getOpcode()) &&
|
||||
all_of(WidenR->operands(), isSingleScalar);
|
||||
}
|
||||
if (auto *WidenR = dyn_cast<VPWidenSelectRecipe>(VPV))
|
||||
return all_of(WidenR->operands(), isSingleScalar);
|
||||
if (auto *VPI = dyn_cast<VPInstruction>(VPV))
|
||||
return VPI->isSingleScalar() || VPI->isVectorToScalar() ||
|
||||
(PreservesUniformity(VPI->getOpcode()) &&
|
||||
|
||||
Reference in New Issue
Block a user