[PATCH] D121727: [NVPTX] Integrate ptxas to LIT tests

Joel E. Denny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 18 15:00:42 PDT 2022


jdenny added a comment.

In D121727#3393453 <https://reviews.llvm.org/D121727#3393453>, @jhenderson wrote:

> In D121727#3393386 <https://reviews.llvm.org/D121727#3393386>, @jdenny wrote:
>
>> In D121727#3393335 <https://reviews.llvm.org/D121727#3393335>, @jhenderson wrote:
>>
>>> Of course, this above has a lot of duplicated code, so it might be nice to make the if an if/else ternary-style. Spitball idea:
>>>
>>>   RUN: ... | FileCheck %s --check-prefix={%if windows {WINDOWS} else {NON-WINDOWS}}
>>
>> I like this direction as it seems more flexible.  Why do we need the outermost braces?
>
> Because the `else` might be optional, so it clearly delineates the if/else block, as opposed to something using the term "else" immediately after the if part. I'm open to other suggestions on this though.

I think `else` -> `%else` should fix the parsing issue.

>>> Bonus points would allow this if to span multiple lines. Maybe this:
>>>
>>>   RUN: {%if feature { \
>>>   RUN:   command1; \
>>>   RUN:   command2 | \
>>>   RUN:   command3}}
>>
>> Might be nice if the `\` is not required so it's possible to enclose multiple existing RUN lines without having to join them with `;`, `&&`, etc.
>
> Agreed, though I don't have a clear view of how this might work, since the RUN lines are done pre-subsititution (I think, not actually checked), and I see this "if" style as a kind of conditionalised substitution.

In my downstream work, I managed to implement a lit `%for data {...}` syntax that unrolls its body's RUN lines before handing things to the shell.  It does not require `\`.  Based on that, we can probably get `%if` without `\` to work somehow.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121727



More information about the llvm-commits mailing list