[all-commits] [llvm/llvm-project] 98ba0a: [InstCombine] Handle gc.relocate(null) in one iter...

serguei-katkov via All-commits all-commits at lists.llvm.org
Thu Aug 13 09:22:51 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 98ba0a5ffee219f503a9dc2526f609da832ebf01
      https://github.com/llvm/llvm-project/commit/98ba0a5ffee219f503a9dc2526f609da832ebf01
  Author: Serguei Katkov <serguei.katkov at azul.com>
  Date:   2020-08-13 (Thu, 13 Aug 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    A llvm/test/Transforms/InstCombine/statepoint-iter.ll

  Log Message:
  -----------
  [InstCombine] Handle gc.relocate(null) in one iteration

InstCombine adds users of transformed instruction to working list to
process on the same iteration. However gc.relocate may have a hidden
user (next gc.relocate) which is connected through gc.statepoint intrinsic and
there is no direct def-use chain between them.

In this case if the next gc.relocation is already processed it will not be added
to worklist and will not be able to be processed on the same iteration.
Let's we have the following case:
A = gc.relocate(null)
B = statepoint(A)
C = gc.relocate(B, hidden(A))
If C is already considered then after replacement of A with null, statepoint B
instruction will be added to the queue but not C.
C can be processed only on the next iteration.

If the chain of relocation is pretty long the many iteration may be required.
This change is to reduce the number of iteration to meet the latest changes
related to reducing infinite loop threshold.

This is a quick (not best) fix. In the follow up patches I plan to move gc relocation
handling into statepoint handler. This should also help to remove unused gc live
entries in statepoint bundle.

Reviewers: reames, dantrushin
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D75598




More information about the All-commits mailing list