Skip to content

[NFC][AMDGPU] Automate any_extend_vector_inreg.ll check line generation #145013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

chrisjbris
Copy link
Contributor

Convert the test to use update_llc_test_checks.py.

Convert the test to use update_llc_test_checks.py.
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Member

llvmbot commented Jun 20, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Chris Jackson (chrisjbris)

Changes

Convert the test to use update_llc_test_checks.py.


Full diff: https://github.com/llvm/llvm-project/pull/145013.diff

1 Files Affected:

  • (modified) llvm/test/CodeGen/AMDGPU/any_extend_vector_inreg.ll (+142-23)
diff --git a/llvm/test/CodeGen/AMDGPU/any_extend_vector_inreg.ll b/llvm/test/CodeGen/AMDGPU/any_extend_vector_inreg.ll
index 8bcef24c8e23d..ce53f1e460262 100644
--- a/llvm/test/CodeGen/AMDGPU/any_extend_vector_inreg.ll
+++ b/llvm/test/CodeGen/AMDGPU/any_extend_vector_inreg.ll
@@ -1,30 +1,149 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
 ; RUN: llc -mtriple=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
-; RUN: llc -mtriple=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
+; RUN: llc -mtriple=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck -check-prefix=GCNF %s
 
-; GCN-LABEL: {{^}}any_extend_vector_inreg_v16i8_to_v4i32:
-; GCN: s_load_dwordx8
-; GCN-DAG: s_load_dword
 
-; GCN: {{buffer|flat}}_store_byte
-; GCN: {{buffer|flat}}_store_byte
-; GCN: {{buffer|flat}}_store_byte
-; GCN: {{buffer|flat}}_store_byte
-
-; GCN: {{buffer|flat}}_store_byte
-; GCN: {{buffer|flat}}_store_byte
-; GCN: {{buffer|flat}}_store_byte
-; GCN: {{buffer|flat}}_store_byte
-
-; GCN: {{buffer|flat}}_store_byte
-; GCN: {{buffer|flat}}_store_byte
-; GCN: {{buffer|flat}}_store_byte
-; GCN: {{buffer|flat}}_store_byte
-
-; GCN: {{buffer|flat}}_store_byte
-; GCN: {{buffer|flat}}_store_byte
-; GCN: {{buffer|flat}}_store_byte
-; GCN: {{buffer|flat}}_store_byte
 define amdgpu_kernel void @any_extend_vector_inreg_v16i8_to_v4i32(ptr addrspace(1) nocapture readonly %arg, ptr addrspace(1) %arg1) local_unnamed_addr #0 {
+; GCN-LABEL: any_extend_vector_inreg_v16i8_to_v4i32:
+; GCN:       ; %bb.0: ; %bb
+; GCN-NEXT:    s_load_dwordx4 s[12:15], s[4:5], 0x9
+; GCN-NEXT:    s_mov_b32 s3, 0xf000
+; GCN-NEXT:    s_mov_b32 s2, -1
+; GCN-NEXT:    v_mov_b32_e32 v0, 0
+; GCN-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-NEXT:    s_mov_b32 s0, s14
+; GCN-NEXT:    s_mov_b32 s1, s15
+; GCN-NEXT:    s_load_dwordx8 s[4:11], s[12:13], 0x0
+; GCN-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-NEXT:    s_load_dword s4, s[12:13], 0x8
+; GCN-NEXT:    buffer_store_byte v0, off, s[0:3], 0 offset:13
+; GCN-NEXT:    buffer_store_byte v0, off, s[0:3], 0 offset:15
+; GCN-NEXT:    buffer_store_byte v0, off, s[0:3], 0 offset:14
+; GCN-NEXT:    buffer_store_byte v0, off, s[0:3], 0 offset:8
+; GCN-NEXT:    buffer_store_byte v0, off, s[0:3], 0 offset:11
+; GCN-NEXT:    buffer_store_byte v0, off, s[0:3], 0 offset:10
+; GCN-NEXT:    buffer_store_byte v0, off, s[0:3], 0 offset:4
+; GCN-NEXT:    buffer_store_byte v0, off, s[0:3], 0 offset:6
+; GCN-NEXT:    buffer_store_byte v0, off, s[0:3], 0 offset:1
+; GCN-NEXT:    buffer_store_byte v0, off, s[0:3], 0
+; GCN-NEXT:    buffer_store_byte v0, off, s[0:3], 0 offset:3
+; GCN-NEXT:    s_lshr_b32 s8, s9, 16
+; GCN-NEXT:    s_waitcnt expcnt(0)
+; GCN-NEXT:    v_mov_b32_e32 v0, s6
+; GCN-NEXT:    s_waitcnt lgkmcnt(0)
+; GCN-NEXT:    s_lshl_b64 s[6:7], s[4:5], 8
+; GCN-NEXT:    v_mov_b32_e32 v1, s11
+; GCN-NEXT:    buffer_store_byte v1, off, s[0:3], 0 offset:9
+; GCN-NEXT:    s_waitcnt expcnt(0)
+; GCN-NEXT:    v_mov_b32_e32 v1, s5
+; GCN-NEXT:    buffer_store_byte v1, off, s[0:3], 0 offset:2
+; GCN-NEXT:    v_alignbit_b32 v0, s8, v0, 16
+; GCN-NEXT:    s_waitcnt expcnt(0)
+; GCN-NEXT:    v_mov_b32_e32 v1, s7
+; GCN-NEXT:    buffer_store_byte v1, off, s[0:3], 0 offset:12
+; GCN-NEXT:    s_waitcnt expcnt(0)
+; GCN-NEXT:    v_lshrrev_b32_e32 v1, 8, v0
+; GCN-NEXT:    v_lshrrev_b32_e32 v0, 24, v0
+; GCN-NEXT:    buffer_store_byte v1, off, s[0:3], 0 offset:5
+; GCN-NEXT:    buffer_store_byte v0, off, s[0:3], 0 offset:7
+; GCN-NEXT:    s_endpgm
+;
+; GCNF-LABEL: any_extend_vector_inreg_v16i8_to_v4i32:
+; GCNF:       ; %bb.0: ; %bb
+; GCNF-NEXT:    s_load_dwordx4 s[8:11], s[4:5], 0x24
+; GCNF-NEXT:    v_mov_b32_e32 v2, 0
+; GCNF-NEXT:    s_waitcnt lgkmcnt(0)
+; GCNF-NEXT:    s_load_dwordx8 s[0:7], s[8:9], 0x0
+; GCNF-NEXT:    s_waitcnt lgkmcnt(0)
+; GCNF-NEXT:    s_load_dword s0, s[8:9], 0x20
+; GCNF-NEXT:    s_lshr_b32 s6, s5, 24
+; GCNF-NEXT:    s_lshr_b32 s8, s2, 24
+; GCNF-NEXT:    s_waitcnt lgkmcnt(0)
+; GCNF-NEXT:    s_lshl_b64 s[2:3], s[0:1], 8
+; GCNF-NEXT:    s_add_u32 s4, s10, 13
+; GCNF-NEXT:    s_addc_u32 s5, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s4
+; GCNF-NEXT:    v_mov_b32_e32 v1, s5
+; GCNF-NEXT:    s_add_u32 s4, s10, 15
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s5, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s4
+; GCNF-NEXT:    v_mov_b32_e32 v1, s5
+; GCNF-NEXT:    s_add_u32 s4, s10, 14
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s5, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s4
+; GCNF-NEXT:    v_mov_b32_e32 v1, s5
+; GCNF-NEXT:    s_add_u32 s4, s10, 8
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s5, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s4
+; GCNF-NEXT:    v_mov_b32_e32 v1, s5
+; GCNF-NEXT:    s_add_u32 s4, s10, 11
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s5, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s4
+; GCNF-NEXT:    v_mov_b32_e32 v1, s5
+; GCNF-NEXT:    s_add_u32 s4, s10, 10
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s5, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s4
+; GCNF-NEXT:    v_mov_b32_e32 v1, s5
+; GCNF-NEXT:    s_add_u32 s4, s10, 4
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s5, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s4
+; GCNF-NEXT:    v_mov_b32_e32 v1, s5
+; GCNF-NEXT:    s_add_u32 s4, s10, 6
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s5, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s4
+; GCNF-NEXT:    v_mov_b32_e32 v1, s5
+; GCNF-NEXT:    s_add_u32 s4, s10, 1
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s5, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s4
+; GCNF-NEXT:    v_mov_b32_e32 v1, s5
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    v_mov_b32_e32 v0, s10
+; GCNF-NEXT:    v_mov_b32_e32 v1, s11
+; GCNF-NEXT:    s_add_u32 s4, s10, 3
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s5, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s4
+; GCNF-NEXT:    v_mov_b32_e32 v1, s5
+; GCNF-NEXT:    s_add_u32 s4, s10, 9
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s5, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s4
+; GCNF-NEXT:    v_mov_b32_e32 v1, s5
+; GCNF-NEXT:    v_mov_b32_e32 v2, s7
+; GCNF-NEXT:    s_add_u32 s4, s10, 2
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s5, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s4
+; GCNF-NEXT:    v_mov_b32_e32 v1, s5
+; GCNF-NEXT:    v_mov_b32_e32 v2, s1
+; GCNF-NEXT:    s_add_u32 s0, s10, 5
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s1, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s0
+; GCNF-NEXT:    v_mov_b32_e32 v1, s1
+; GCNF-NEXT:    v_mov_b32_e32 v2, s8
+; GCNF-NEXT:    s_add_u32 s0, s10, 12
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s1, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s0
+; GCNF-NEXT:    v_mov_b32_e32 v1, s1
+; GCNF-NEXT:    v_mov_b32_e32 v2, s3
+; GCNF-NEXT:    s_add_u32 s0, s10, 7
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_addc_u32 s1, s11, 0
+; GCNF-NEXT:    v_mov_b32_e32 v0, s0
+; GCNF-NEXT:    v_mov_b32_e32 v1, s1
+; GCNF-NEXT:    v_mov_b32_e32 v2, s6
+; GCNF-NEXT:    flat_store_byte v[0:1], v2
+; GCNF-NEXT:    s_endpgm
 bb:
   %tmp2 = load <16 x i8>, ptr addrspace(1) %arg, align 16
   %tmp3 = extractelement <16 x i8> %tmp2, i64 4

@chrisjbris chrisjbris merged commit cbd4965 into llvm:main Jun 20, 2025
5 of 7 checks passed
Copy link

@chrisjbris Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 20, 2025

LLVM Buildbot has detected a new failure on builder llvm-x86_64-debian-dylib running on gribozavr4 while building llvm at step 6 "test-build-unified-tree-check-clang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/60/builds/30761

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-clang) failure: test (failure)
******************** TEST 'Clang :: Analysis/ftime-trace.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/b/1/llvm-x86_64-debian-dylib/build/bin/clang -cc1 -internal-isystem /b/1/llvm-x86_64-debian-dylib/build/lib/clang/21/include -nostdsysteminc -analyze -analyzer-constraints=range -setup-static-analyzer -analyzer-checker=core /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/Analysis/ftime-trace.cpp -ftime-trace=/b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/Analysis/Output/ftime-trace.cpp.tmp.raw.json -ftime-trace-granularity=0 -verify # RUN: at line 1
+ /b/1/llvm-x86_64-debian-dylib/build/bin/clang -cc1 -internal-isystem /b/1/llvm-x86_64-debian-dylib/build/lib/clang/21/include -nostdsysteminc -analyze -analyzer-constraints=range -setup-static-analyzer -analyzer-checker=core /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/Analysis/ftime-trace.cpp -ftime-trace=/b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/Analysis/Output/ftime-trace.cpp.tmp.raw.json -ftime-trace-granularity=0 -verify
"/usr/bin/python3.9" -c 'import json, sys; print(json.dumps(json.load(sys.stdin), indent=4))' < /b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/Analysis/Output/ftime-trace.cpp.tmp.raw.json > /b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/Analysis/Output/ftime-trace.cpp.tmp.formatted.json # RUN: at line 2
+ /usr/bin/python3.9 -c 'import json, sys; print(json.dumps(json.load(sys.stdin), indent=4))'
/b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck --input-file=/b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/Analysis/Output/ftime-trace.cpp.tmp.formatted.json --check-prefix=CHECK /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/Analysis/ftime-trace.cpp # RUN: at line 3
+ /b/1/llvm-x86_64-debian-dylib/build/bin/FileCheck --input-file=/b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/Analysis/Output/ftime-trace.cpp.tmp.formatted.json --check-prefix=CHECK /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/Analysis/ftime-trace.cpp
/b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/Analysis/ftime-trace.cpp:34:11: error: CHECK: expected string not found in input
// CHECK: "name": "Total CheckerManager::runCheckersForStmt (Pre)",
          ^
/b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/Analysis/Output/ftime-trace.cpp.tmp.formatted.json:2562:3: note: scanning from here
 }
  ^
/b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/Analysis/Output/ftime-trace.cpp.tmp.formatted.json:2738:2: note: possible intended match here
 "name": "Total CheckerManager::runCheckersForStmt (Post)",
 ^

Input file: /b/1/llvm-x86_64-debian-dylib/build/tools/clang/test/Analysis/Output/ftime-trace.cpp.tmp.formatted.json
Check file: /b/1/llvm-x86_64-debian-dylib/llvm-project/clang/test/Analysis/ftime-trace.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            .
            .
            .
         2557:  "dur": 1072, 
         2558:  "name": "Total dispatchWorkItem PostStmt", 
         2559:  "args": { 
         2560:  "count": 31, 
         2561:  "avg ms": 0 
         2562:  } 
check:34'0       X error: no match found
         2563:  }, 
check:34'0     ~~~~
         2564:  { 
check:34'0     ~~~
         2565:  "pid": 3765398, 
check:34'0     ~~~~~~~~~~~~~~~~~
         2566:  "tid": 3765405, 
check:34'0     ~~~~~~~~~~~~~~~~~
         2567:  "ph": "X", 
check:34'0     ~~~~~~~~~~~~
            .
            .
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy