[llvm] VPlan: prepare to recursively simplify recipes (PR #105699)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 26 04:13:06 PDT 2024
================
@@ -1009,8 +1015,16 @@ static void simplifyRecipes(VPlan &Plan, LLVMContext &Ctx) {
Plan.getEntry());
VPTypeAnalysis TypeInfo(Plan.getCanonicalIV()->getScalarType(), Ctx);
for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(RPOT)) {
- for (VPRecipeBase &R : make_early_inc_range(*VPBB)) {
- simplifyRecipe(R, TypeInfo);
+ // Populate a Worklist, as simplifyRecipe might return a new recipe that we
----------------
artagnon wrote:
> How can the pattern introduce a single new recipe? If we return the recipe X && (Y || Z), how will a pattern like X && true or X && false suffice? In other words, how can we ensure that Y || Z is re-queued for simplification? If we return the recipe Y || Z, that recipe might be simplfied, but then how does the root recipe involving X get re-queued for simplification?
I checked, and we do indeed need to return both the root recipe and sub-recipe.
https://github.com/llvm/llvm-project/pull/105699
More information about the llvm-commits
mailing list