[PATCH] D80445: [EarlyCSE] Common gc.relocate calls.

Denis Antrushin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 23 00:29:32 PDT 2020


dantrushin added a comment.

In D80445#2051699 <https://reviews.llvm.org/D80445#2051699>, @reames wrote:

> Just to be clear, if the indices are the same, gc.relocates would already be removed right?  i.e. the thing you're trying to solve is that the standpoint can have two operands which are the same value and thus two gc.relocates which are equivalent but not textually identical?  Just want to make sure I understand the problem properly.


That's right.

> Another solution to the same problem would be to canonicalize the statepoint in an instcombine rule to avoid duplicate operands in the gc operand section.  Have you explored that possibility?

Well, CSE solution looked to me more elegant - all I need is adjust hash and the rest will be done automatically. 
While in instcombine after statepoint operand uniqueing I would have to visit all relocates and update them. Second logical step would be to implement gc.relocate CSE'ing there which I didn't want to do.
And operand uniqueing itself is sort of CSE, so I would need to implement it in InstCombine using some sort of Set etc.

Also, operands might be equivalent, but not textually identical, which InstCombine cannot handle.
(I'm not sure if LLVM's CSE can. This sounds as value numbering).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80445/new/

https://reviews.llvm.org/D80445





More information about the llvm-commits mailing list