[llvm] [VPlan] Avoid copying over nsw on certain inductions (PR #168922)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 11:47:02 PST 2025


https://github.com/fhahn commented:

It's not clear from the description why negative step/start values would be a problem for wide inductions, as we still compute the same values as the original scalar induction.

Looking at the reproduce, it looks like the issue is that the induciton phi has been truncated to i8, after which nsw no longer holds. If that's the case, flags should be dropped when optimizing the truncate and forming a narrow IV.

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


More information about the llvm-commits mailing list