This is an archive of the discontinued LLVM Phabricator instance.

[GVN] Simple GVNHoist - limits
Needs ReviewPublic

Authored by chill on Oct 8 2021, 8:25 AM.

Details

Summary

This patch adds a parameter limiting how deep in a block we go looking
for instructions to hoist.

It also prevents certain instructions from initiating the hoist of a
dependency chain with the goal to not separate them from their
users. Such instructions are:

  • GEPs, with the intent to keep them together with the (comparatively harder to hoist) loads/stores
  • binary ops, which are converted to boolean by comparing them to zero: often the result of comparison to zero is (or can be chosen to be) a side effect from the original computation
  • conditions to br and select instructions

Nevertheless, such instructions can be hoisted, if the process starts
from their users.

Diff Detail

Event Timeline

chill created this revision.Oct 8 2021, 8:25 AM
chill requested review of this revision.Oct 8 2021, 8:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2021, 8:25 AM

Would it better use some parameter from GVNHoist? Also I do think maybe the default value is too large.

chill updated this revision to Diff 381936.Oct 25 2021, 4:29 AM
chill added a comment.Oct 25 2021, 4:32 AM

Would it better use some parameter from GVNHoist? Also I do think maybe the default value is too large.

I wanted to be independent from GVNHoist.cpp, e.g. choose different defaults. Indeed, defaults may well be large, I'm going to look
at various benchmarks and defaults' effect on them, and maybe change the defaults.

This revision is now accepted and ready to land.Nov 1 2021, 8:39 PM
chill updated this revision to Diff 384383.Nov 3 2021, 3:20 AM
chill edited the summary of this revision. (Show Details)
  • Removed the maximum chain length limit as the current implementation does not iterate and does not need renumbering as the original GVNHoist
  • Spent some effort to not separate certain instructions from their users (that's an outcome from some tuning/regression fixing with various benchmarks).
chill requested review of this revision.Nov 3 2021, 3:23 AM
chill updated this revision to Diff 385549.Nov 8 2021, 10:03 AM
mkazantsev resigned from this revision.Mar 4 2022, 12:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2022, 12:14 AM
reames resigned from this revision.Mar 5 2022, 12:50 PM