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

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 14:46:26 PDT 2022


tra added a subscriber: mstorsjo.
tra added a comment.

In D121727#3390353 <https://reviews.llvm.org/D121727#3390353>, @asavonic wrote:

> - Added a draft for `%(when cond command)` LIT syntax.



> RUN: %(when ptxas ptxas -c %t-nvptx.ptx -o /dev/null)

That may work. I'd change the syntax a bit to separate the condition check from command itself.
E.g. something like `RUN: %when(ptxas)  ptxas -c %t-nvptx.ptx -o /dev/null`

Perhaps we can just expose available features via environment variables and then let shell do the work.
E.g. set LIT_HAS_PTXAS=1 and then use `RUN:  ((LIT_HAS_PTXAS)) && ptxas command`

The downside of this approach is that it assumes that we do run tests using shell, which may not always be the case (on Windows?).

Another approach would be to use `RUN-<feature>:` to mark conditional lines. Or `RUNIF:feature1,feature2:`

I'm just thinking out loud. Some sort of `%when` predicate would work for me, but I'm not the owner of lit. Speaking of owners, we should add someone familiar to the review. 
Summoning @mstorsjo  -- WDYT?


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