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

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 15:00:26 PDT 2022


mstorsjo added a subscriber: jdenny.
mstorsjo added a comment.

In D121727#3390620 <https://reviews.llvm.org/D121727#3390620>, @tra wrote:

> 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?).

Tests can either be executed by the lit internal shell, or by shelling out to Windows. Within the llvm/clang testsuites, the lit internal shell is used by default on Windows, but not e.g. in the libcxx testsuite: https://github.com/llvm/llvm-project/blob/main/llvm/utils/lit/lit/llvm/config.py#L25-L42

The lit internal shell can handle a fair bit of expressions, but I'm not sure if it handles this feature.

> 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?

Not much opinions on the suggested ways of implementing this. I think @jdenny is code owner (or the closest thing) for lit, I think he'd have more input on the direction here.


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