This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Move handling of gc.relocate in a gc.statepoint
ClosedPublic

Authored by skatkov on Aug 13 2020, 8:27 PM.

Details

Summary

The only def for gc.relocate is a gc.statepoint. But real dependency is not
described by def-use chain. Instead this dependency is encoded by indecies
of operands in gc-live bundle of statepoint as integer constants in gc.relocate.

InstCombine operates by def-use chain. As a result when value in gc-live bundle
is simplified the gc.statepoint itself is not simplified but it might simplify dependent
gc.relocates. To trigger the optimization of gc.relocate we now unconditionally trigger
check of all dependent gc.relocates by adding them to worklist.

This CL handles of gc.relocates as process of gc.statepoint optimization considering
gc.statepoint and related gc.relocate as whole entity.

Diff Detail

Event Timeline

skatkov created this revision.Aug 13 2020, 8:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2020, 8:27 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
skatkov requested review of this revision.Aug 13 2020, 8:27 PM

LGTM

As a follow up, it would be nice to handle two additional optimizations:

  1. Canonicalize each pointer to a single index in the statepoint operand list
  2. Shrink the gc-live bundle to remove any pointers not needed after (1)
reames accepted this revision.Aug 21 2020, 8:25 AM
This revision is now accepted and ready to land.Aug 21 2020, 8:25 AM

LGTM

As a follow up, it would be nice to handle two additional optimizations:

  1. Canonicalize each pointer to a single index in the statepoint operand list
  2. Shrink the gc-live bundle to remove any pointers not needed after (1)

See https://reviews.llvm.org/D85959.

Thank you for review.