[llvm] [VPlan] Reassociate (x & y) & z -> x & (y & z) (PR #155383)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 4 00:50:43 PDT 2025


Mel-Chen wrote:

> > Would this make EVL lowering depend on simplifyRecipes, making it harder to move addExplicitVectorLength into tryToBuildVPlanWithVPRecipes #153144?
> 
> optimizeMaskToEVL already depends on simplifyRecipes to help detect the header mask, it shouldn't be moved to tryToBuildVPlanWithVPRecipes. Only the variable stepping transform needs to go in tryToBuildVPlanWithVPRecipes. So it shouldn't make things harder

Hmm, it seems we have a bit of a mismatch in understanding.
```
// TODO: try to put it close to addActiveLaneMask().
```
To me, this TODO comment means moving all of EVL lowering into tryToBuildVPlanWithVPRecipes, and then removing the header mask there in the same way as addActiveLaneMask. But I guess your idea is to leave the header mask removal to be handled later in ::optimize, right? If we settle on a clear direction, I think we should update this TODO comment to avoid confusion.

https://github.com/llvm/llvm-project/pull/155383


More information about the llvm-commits mailing list