[llvm] [VPlan] Use DIV nuw when optimizing latch exit user (PR #212292)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 29 04:24:39 PDT 2026
artagnon wrote:
> I think it is still not quite right and it looks like there may be an Alive2 bug somewhere. If I delete the sceond set of functions, the first set of functions fails to verify: https://alive2.llvm.org/ce/z/Rra7Wu
>
> The target function adds `nuw` to the increment, but the phi starts at -1, so will warp in the first iteration.
>
> Also I think the proof would need to be the other way around: src should have increment with `nuw` + instruction sequence to compute the end value from the exit count as DerivedIV will be expanded, without NUW.
>
> `tgt` should have `nuw` added to the sequence computing the final value as the new code would generate.
Um, the first set of functions are supposed to fail, and fail in the original link as well. Yes, the difference is nuw on the exit value: totally missed that. Hopefully clearer, more general, and correct? https://alive2.llvm.org/ce/z/zDzViR
https://github.com/llvm/llvm-project/pull/212292
More information about the llvm-commits
mailing list