This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] (udiv X, Y) * Y is always NUW
ClosedPublic

Authored by reames on Sep 14 2021, 2:02 PM.

Details

Summary

Motivated by the removal done in D109782. This implements the correct flag part generically.

Diff Detail

Event Timeline

reames created this revision.Sep 14 2021, 2:02 PM
reames requested review of this revision.Sep 14 2021, 2:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2021, 2:02 PM
nikic added inline comments.Sep 14 2021, 2:10 PM
llvm/lib/Analysis/ScalarEvolution.cpp
2403

I think this only covers a subset of cases because it assumes the udiv is the first operand. Due to complexity sorting, this is a given for the case where Y is SCEVUnknown, but wouldn't we want this to trigger also for something like 3 * (udiv X, 3)?

2404

I believe UDiv always has two operands, multi operand udiv isn't well-defined...

reames updated this revision to Diff 372578.Sep 14 2021, 3:37 PM

Address reviewer comment

reames updated this revision to Diff 372581.Sep 14 2021, 3:44 PM

additional test update from broader scope - should have finished for ninja check to finish.

nikic accepted this revision.Sep 15 2021, 8:37 AM

LGTM

This revision is now accepted and ready to land.Sep 15 2021, 8:37 AM
This revision was landed with ongoing or failed builds.Sep 15 2021, 11:35 AM
This revision was automatically updated to reflect the committed changes.