[PATCH] D144125: [VPlan] Improve VPRecipeBase::isPhi checking

Michael Maitland via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 13:31:28 PST 2023


michaelmaitland added a comment.

In D144125#4133014 <https://reviews.llvm.org/D144125#4133014>, @michaelmaitland wrote:

> @fhahn is there a reason why `VPWidenIntOrFpInductionRecipe` does not extend `VPHeaderPHIRecipe`? That might be a better solution than this one.

To respond to my own question:

I imagine `VPWidenIntOrFpInductionRecipe` does not extend `VPHeaderPHIRecipe` because if its changed to derive `VPHeaderPHIRecipe`, the PHI is the only one that can define this VPValue, even though there are two constructors which would like to set different underlying values for this VPValue:

1. IV defines this VPValue
2. Trunc defines this VPValue

An additional reason why it does not extend is:
 > `VPWidenIntOrFPInductionRecipe` are not in the phi section of the header block for truncates of induction variables. Those recipes are moved to the phi section of the header block after applying SinkAfter, which relies on the original position of the trunc.

Therefore, I prefer the proposed solution.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144125/new/

https://reviews.llvm.org/D144125



More information about the llvm-commits mailing list