[PATCH] D125212: [GlobalISel] Allow destination patterns having empty outs

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 14:56:11 PDT 2022


arsenm added a comment.

In D125212#3510705 <https://reviews.llvm.org/D125212#3510705>, @abinavpp wrote:

> In D125212#3500234 <https://reviews.llvm.org/D125212#3500234>, @arsenm wrote:
>
>> I do think there should be a builtin hasOneUse pattern predicate the emitter could use to verify
>
> If we have a `bit HasNoUse` builtin predicate in PatFrags we can get the matcher
> table to check the empty usage of the result without the generic C++ predicates.
> The problem I'm seeing here is that the default behaviour should be to not check
> for the use count since most of the selection doesn't care about it. Having a
> ternary HasNoUse builtin is fine since we could set it to false for selection
> that needs at least 1 use (e.g.: AMDGPU's return atomic ops), true for selection
> that needs no use (e.g.: AMDGPU's no return atomic ops), "don't care" for the
> majority of the other selections. I don't think we can rely on the '?'
> (uninitialized) value since TreePredicateFn::isPredefinedPredicateEqualTo()
> return false for uninitialized fields.
>
> How should we do this?

Having a false/unset builtin HasOneUse predicate doesn't imply applying the negated predicate. It would just be nothing. If we wanted a hasOneOrMultiple predicate, it would be a separate PatFrag bit


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125212



More information about the llvm-commits mailing list