[llvm] [IndVars] Preserve flags of narrow IV inc if replacing with wider inc. (PR #80446)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 5 11:25:49 PST 2024
fhahn wrote:
> (This question also goes for the similar change at #79512...)
>
> Are we guaranteed matching increments at this point? I.e. do we know that both instructions actually increment by the same amount, and we don't have, say, a `iv.next = iv - 7 + 12` sequence on one end and `iv.next = iv + 5` on the other?
I couldn't find a case where this would happen and cause incorrect use of flags by adding various assertions, but in theory I think it may happen. Updated the code to check that the increments both directly operate on the respective phis and have the same opcode. this should also imply the same step (module extensions) assuming the start is the same.
https://github.com/llvm/llvm-project/pull/80446
More information about the llvm-commits
mailing list