This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Do not strengthen nuw/nsw flags during get[Zero,Sign]ExtendedExpr.
ClosedPublic

Authored by fhahn on Feb 14 2023, 3:14 PM.

Details

Summary

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.

Diff Detail

Event Timeline

fhahn created this revision.Feb 14 2023, 3:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2023, 3:14 PM
fhahn requested review of this revision.Feb 14 2023, 3:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2023, 3:14 PM
mkazantsev accepted this revision.Mar 6 2023, 8:56 PM
mkazantsev added inline comments.
llvm/test/Transforms/IndVarSimplify/lftr-reuse.ll
149

Put a TODO before this test so that we don't forget it?

This revision is now accepted and ready to land.Mar 6 2023, 8:56 PM
nikic added a comment.Mar 7 2023, 12:10 AM

There are some test failures.

fhahn added a comment.Mar 7 2023, 11:23 AM

It looks like the test failures were from earlier runs, possibly with a missing dependency. I re-run them and they came back clear (on Windows, ClangdTests.exe/IncludeCleaner/GenerateMissingHeaderDiags failed, but that's very likely unrelated)

This revision was landed with ongoing or failed builds.Mar 15 2023, 1:57 PM
This revision was automatically updated to reflect the committed changes.
fhahn marked an inline comment as done.Mar 15 2023, 1:59 PM
fhahn added inline comments.
llvm/test/Transforms/IndVarSimplify/lftr-reuse.ll
149

Thanks, added in the committed version!