[llvm] [VPlan] Use vputils::findCanonicalIVIncrement in more places. NFC (PR #226516)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 01:50:07 PDT 2026


lukel97 wrote:

> Do you already have concrete pointers as to in which cases this would be needed in the future?
> 
> In general, I think it would be preferable to rely on the structure instead of this lookup unless absolutely not possible

Yeah, I can submit a stacked PR on top of this that uses this. The main thing is for tail folded early exit VPlans because the terminator is no longer a BranchOnCount/BranchOnCount. 

Using vputils:: findCanonicalIVIncrement means that you don't need to explicitly teach each tail-folding related pass about the early exit structure. 

If we want it to be structural we could change findCanonicalIVIncrement so it tries to find the increment from the terminator, and handle BranchOnTwoConds there?

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


More information about the llvm-commits mailing list