[llvm] [LV][EVL] Replace VPInstruction::Select with vp.merge for predicated div/rem (PR #154072)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 18 01:38:29 PDT 2025


lukel97 wrote:

I'm not sure if this is the right approach, since it still leaves around a vmv.v.i to mask the divisor. What I originally tried in #148828 was to fold the div/rem into a VP div/rem, but in that PR it was relying on nothing in the VPlan ever reading past EVL lanes.

What I think is safer is to emit the VP intrinsic when the recipe is initially being widened using a mask, that way we know the lanes are defined as poison, and then optimising the mask to EVL in`optimizeMaskToEVL`. I've opened up #154076 for this, what do you think?

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


More information about the llvm-commits mailing list