[llvm] [VPlan] Don't apply predication discount to non-originally-predicated blocks (PR #160449)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 24 02:28:13 PDT 2025


david-arm wrote:

Thanks to @lukel97 and @fhahn for explaining! Just to be clear, I won't hold up the patch. I realise this is for a different day and a different PR, but it seems to me the root problem here is that we make the decision to tail-fold the loop far too early without considering the cost of doing so, then everything else afterwards has to try very hard to unwind the extremely poor early decision. Whereas if we'd avoided tail-folding in the first place, i.e. by at least checking to see if the target supports masked loads and stores, then we may avoid some of the extra complexity of rolling back. Alternatively, if we'd chosen from two VPlans per VF using different styles of vectorisation then we may end up with a better choice than simply not vectorising.

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


More information about the llvm-commits mailing list