[PATCH] D135331: [AMDGPU] Add test coverage to ensure first regallocfast only allocates SGPR
Jeffrey Byrnes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 5 16:17:41 PDT 2022
jrbyrnes created this revision.
jrbyrnes added reviewers: arsenm, rampitec.
Herald added subscribers: kosarev, kerbowa, t-tye, tpr, dstuttard, yaxunl, jvesely, kzhuravl, qcolombet, MatzeB.
Herald added a project: All.
jrbyrnes requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
Register allocation is split into two passes, and the expected behavior is that the first pass only should only work on virtual SGPRs. Whereas the second pass works on virtual VGPRs. This adds a test case which breaks if the first pass allocates VGPRs.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D135331
Files:
llvm/test/CodeGen/AMDGPU/fastregalloc-sgpr-only.mir
Index: llvm/test/CodeGen/AMDGPU/fastregalloc-sgpr-only.mir
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/AMDGPU/fastregalloc-sgpr-only.mir
@@ -0,0 +1,17 @@
+# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
+# RUN: llc -verify-machineinstrs -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -O0 -start-before=regallocfast -stop-after=regallocfast -o - %s | FileCheck -check-prefix=GCN %s
+
+---
+name: copy_not_allocated
+tracksRegLiveness: true
+body: |
+ bb.0:
+ liveins: $vgpr0, $vgpr1, $vgpr4, $vgpr5
+ ; GCN-LABEL: name: copy_not_allocated
+ ; GCN: liveins: $vgpr0, $vgpr1, $vgpr4, $vgpr5
+ ; GCN-NEXT: {{ $}}
+ ; GCN-NEXT: [[COPY:%[0-9]+]]:vreg_64 = COPY killed $vgpr0_vgpr1
+ ; GCN-NEXT: FLAT_STORE_DWORDX2 killed $vgpr4_vgpr5, [[COPY]], 0, 0, implicit $exec, implicit $flat_scr
+ %14:vreg_64 = COPY $vgpr0_vgpr1
+ FLAT_STORE_DWORDX2 $vgpr4_vgpr5, %14:vreg_64, 0, 0, implicit $exec, implicit $flat_scr
+...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135331.465591.patch
Type: text/x-patch
Size: 1028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221005/8cc387f6/attachment.bin>
More information about the llvm-commits
mailing list