[llvm] [SCEV] Restrict wrap flags when construction same AR for multiple phis. (PR #80430)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 06:33:48 PST 2024


fhahn wrote:

> I think the underlying issue here is that our nowrap calculation for pre-inc addrecs is just incorrect -- based on a premise that does not generally hold. I had a patch for this here, but didn't get around to finish it: https://reviews.llvm.org/D148931 Would that fix the problem you ran into as well?
> 

Yes I think that would also be sufficient ( I was a bit surprised that we don't do that already :)), but a  heavier hammer, which is why I wanted to explore alternatives to only checking non-poison;

> I don't think that any fix that involves clearing existing nowrap flags is compatible with SCEVs core design.

Yes right! Ideally I'd like to invalidate all users, completely remove the old SCEV and add it again with the new flags. Updated the patch to use `forgetMemoizedResults`, but I am not sure if that would be enough.

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


More information about the llvm-commits mailing list