[SCEV] Do not strengthen nuw/nsw flags during get[Zero,Sign]ExtendedExpr.
authorFlorian Hahn <flo@fhahn.com>
Wed, 15 Mar 2023 20:57:32 +0000 (20:57 +0000)
committerFlorian Hahn <flo@fhahn.com>
Wed, 15 Mar 2023 20:57:34 +0000 (20:57 +0000)
commit484c622760e2a46aa1b52c7a791ee59543364225
tree970dd2462831f7c51a51982bb18860fad8900643
parentabb05014f90478eadb1fe260ad47af429370c92f
[SCEV] Do not strengthen nuw/nsw flags during get[Zero,Sign]ExtendedExpr.

Modifying AddRecs when constructing other expressions can lead to
surprising changes. It also seems like it is not really beneficial i
most cases.

At the moment, there's a single regression, but we still might be able
to improve the flags at AddRec construction.

Might help with the issue discussed in D143409.

Reviewed By: mkazantsev

Differential Revision: https://reviews.llvm.org/D144051
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/test/Transforms/IndVarSimplify/lftr-reuse.ll