This is an archive of the discontinued LLVM Phabricator instance.

[MachineLICM] Add shouldHoist method to TargetInstrInfo
ClosedPublic

Authored by critson on Feb 2 2022, 3:51 AM.

Details

Summary

Add a shouldHoist method to TargetInstrInfo which is queried by
MachineLICM to override hoisting decisions for a given target.
This mirrors functionality provided by shouldSink.

Diff Detail

Event Timeline

critson created this revision.Feb 2 2022, 3:51 AM
critson requested review of this revision.Feb 2 2022, 3:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2022, 3:51 AM
foad added inline comments.Feb 2 2022, 5:10 AM
llvm/include/llvm/CodeGen/TargetInstrInfo.h
385

Since this hook only allows targets to prevent things from being hoisted, I wonder if "Return false if the instruction should not be hoisted by MachineLICM" would describe it better?

Similarly "override the default behavior" fails to mention that it can only be overridden in one direction.

critson updated this revision to Diff 405537.Feb 2 2022, 11:57 PM
critson marked an inline comment as done.
  • Address reviewer comments.
foad accepted this revision.Feb 3 2022, 12:58 AM

Seems fine to me.

This revision is now accepted and ready to land.Feb 3 2022, 12:58 AM
This revision was landed with ongoing or failed builds.Feb 7 2022, 10:53 PM
This revision was automatically updated to reflect the committed changes.