This is an archive of the discontinued LLVM Phabricator instance.

[ValueTracking] Added support to deduce PHI Nodes values being a power of 2
ClosedPublic

Authored by huangjd on May 10 2022, 12:51 PM.

Details

Summary

Add Value Tracking support to deduce induction variable being a power of 2, allowing urem optimizations

Diff Detail

Event Timeline

huangjd created this revision.May 10 2022, 12:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2022, 12:51 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
huangjd requested review of this revision.May 10 2022, 12:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 10 2022, 12:51 PM
huangjd edited the summary of this revision. (Show Details)May 10 2022, 1:34 PM
huangjd added reviewers: davidxl, Carrot, nikic, spatel, reames.

Added back the revision previously in D124890

The test changes resulting from only this code change should be included in this patch.

nikic added a comment.May 13 2022, 7:54 AM

I think you accidentally uploaded a partial diff (that just addresses review feedback, without the base patch).

huangjd updated this revision to Diff 430543.May 18 2022, 5:58 PM

Added updated unit tests

spatel accepted this revision.May 19 2022, 6:22 AM

LGTM - do you have commit privileges?

Note: it might be worth comparing this code to the SelectionDAG equivalent; that ends by calling computeKnownBits to catch all of the non-special cases while this code just gives up (returns false).

This revision is now accepted and ready to land.May 19 2022, 6:22 AM
This revision was landed with ongoing or failed builds.May 19 2022, 11:39 AM
This revision was automatically updated to reflect the committed changes.

I think arc is confused about the git commits to include and the unit test changes are missing again. I will make a clean diff