[PATCH] D150179: [GlobalISel] Hide hoisted constants behind G_BITCAST to prevent folding.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 07:54:48 PDT 2023


aemerson added a comment.

In D150179#4363870 <https://reviews.llvm.org/D150179#4363870>, @arsenm wrote:

> In D150179#4357513 <https://reviews.llvm.org/D150179#4357513>, @aemerson wrote:
>
>>> For instance, a `G_OPAQUE` instruction like that could be used to prevent infinite combine loop between the target-independent and target combine rules. If the target combine wants to create a pattern that isn't considered optimal by the generic combiner, it could use that opaque instruction to prevent further optimizations.
>>
>> Yeah, I think that's ok too.
>
> Isn't this what the DAG does? There are opaque constants

Pretty much, except Pierre’s suggestion is more of a dedicated barrier instruction (sort of like freeze), whereas OpaqueConstants are just normal constants with a flag bit set. I think a dedicated barrier is better since it’s messy to have two different constant representations in the MIR.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150179



More information about the llvm-commits mailing list