This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add cross-project-tests for WMMA builtins
ClosedPublic

Authored by rovka on Feb 16 2023, 2:30 AM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Commits
rG58dada5f0aad: [AMDGPU] Add cross-project-tests for WMMA builtins
Summary

Add a few tests to make sure we get the expected instruction for the
WMMA builtins (and generally that our builtins and intrinsics are on the
same page and won't blow up).

Diff Detail

Event Timeline

rovka created this revision.Feb 16 2023, 2:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2023, 2:30 AM
rovka requested review of this revision.Feb 16 2023, 2:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2023, 2:30 AM
rovka added a reviewer: Restricted Project.Feb 16 2023, 2:32 AM
foad added a subscriber: foad.Feb 16 2023, 2:36 AM

cross-project-tests is new to me, but this certainly looks pretty useful - thanks!

rovka added a comment.Feb 16 2023, 2:42 AM

cross-project-tests is new to me, but this certainly looks pretty useful - thanks!

Right, we'll have to add cross-project-tests to LLVM_ENABLE_PROJECTS to the buildbots/other CI to get them to actually run. Now that I think about it, I should probably remove the EXCLUDE_FROM_CHECK_ALL so we don't have to add this to our ninja invocation too (enabling AMDGPU and the whole cross-project-tests sounds specific enough).

rovka updated this revision to Diff 497957.Feb 16 2023, 3:36 AM

Include new tests in check-all

This is great, I also didn't realize there were such a thing :)

A few nits, but otherwise LGTM

cross-project-tests/CMakeLists.txt
97

The approach in LLVM seems to be to define all check-* targets unconditionally, and let lit sort out what it supported. I think we can drop the condition here (and the result will be that 0 tests are run when building check-amdgpu-cross without the AMDGPU target).

For example:

$ cmake -S llvm -B build -DLLVM_TARGETS_TO_BUILD=X86
$ cmake --build build check-llvm-codegen-amdgpu
Testing Time: 2.08s
Unsupported: 3075
102

I'd prefer check-cross-amdgpu so we match the directory hierarchy, as that seems to be the convention elsewhere (i.e. it is check-llvm-codegen-amdgpu, rather than check-amdgpu-llvm-codegen).

The debuginfo/intrinsic-headers targets appear to break this convention but they are just aliases for convenience.

cross-project-tests/amdgpu/builtins-amdgcn-wmma-w32.cl
2

These REQUIRES can be factored out to the lit.cfg for the amdgpu directory

cross-project-tests/amdgpu/lit.local.cfg
2

i.e. here add or not 'AMDGPU' in config.roots.targets

cross-project-tests/lit.cfg.py
25

Nit: use single quotes to match other literals

This revision was not accepted when it landed; it landed in state Needs Review.Feb 17 2023, 12:21 AM
This revision was automatically updated to reflect the committed changes.

Thanks for catching those :)