[InstCombine] Move handling of gc.relocate in a gc.statepoint
authorSerguei Katkov <serguei.katkov@azul.com>
Wed, 12 Aug 2020 09:09:02 +0000 (16:09 +0700)
committerSerguei Katkov <serguei.katkov@azul.com>
Fri, 21 Aug 2020 16:44:23 +0000 (23:44 +0700)
commit63d9d56a5546c4aed84c39dde797a3ba5bbfaeff
treed7fe7ee92e32fd1ca86e19fdbca0dc2e0ee20252
parent58c305f466d1f78adb10e7295b9bc9fc192a6e09
[InstCombine] Move handling of gc.relocate in a gc.statepoint

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.

Reviewers: reames, dantrushin
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D85954
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp