[PATCH] D151457: [TableGen] Add !getdagargs and !getdagnames

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 31 08:35:31 PDT 2023


hliao added a comment.

In D151457#4383385 <https://reviews.llvm.org/D151457#4383385>, @fpetrogalli wrote:

> In D151457#4382119 <https://reviews.llvm.org/D151457#4382119>, @hliao wrote:
>
>> In D151457#4380793 <https://reviews.llvm.org/D151457#4380793>, @fpetrogalli wrote:
>>
>>> Hey @hliao  - thank you for this patch. Apparently we had a similar idea D151702 <https://reviews.llvm.org/D151702> :)
>>>
>>> I just have a couple of comments.
>>>
>>> Thanks!
>>>
>>> Francesco
>>
>> I proposed another change introducing `!getdagarg` and `!getdagname` to access individual arguments instead of a list of them. Personally, I thought that should be more convenient.
>
> Does it mean that you want to abandon this change?

yeah, `!getdagargs` could be built upon `!getdagarg`. For example, given a dag `input`, `!getdagargs<T>(input)` could be implemented as

  !foreach(i, !range(!size(input)), !getdagarg<T>(input, i)

Even though a little bit verbose, `getdagarg` allows us to examine an individual argument without fetching all arguments. In addition, we also allow using the argument name in addition to the argument index. That allows us to check arguments based on their names conveniently.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151457



More information about the llvm-commits mailing list