File: remaining-virtual-register-operands.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,245,064 kB
  • sloc: cpp: 7,619,731; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,676; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (36 lines) | stat: -rw-r--r-- 1,880 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 -verify-machineinstrs -enable-misched=0 -filetype=null %s 2>&1 | FileCheck -implicit-check-not=error %s

; Scheduler disabled to work around issue #129028

; This testcase fails register allocation at the same time it performs
; virtual register splitting (by introducing VGPR to AGPR copies). We
; still need to enqueue and allocate the newly split vregs after the
; failure.

; The machine verifier should not complain about usage of register
; which is marked as killed in previous instruction.  This happens due
; to when register allocator is out of registers it takes the first
; avialable register.

; CHECK: error: <unknown>:0:0: ran out of registers during register allocation
define amdgpu_kernel void @alloc_failure_with_split_vregs(float %v0, float %v1) #0 {
  %agpr0 = call float asm sideeffect "; def $0", "=${a0}"()
  %agpr.vec = insertelement <16 x float> zeroinitializer, float %agpr0, i32 0
  %mfma0 = call <16 x float> @llvm.amdgcn.mfma.f32.16x16x1f32(float %v0, float %v1, <16 x float> %agpr.vec, i32 0, i32 0, i32 0)
  %mfma0.3 = extractelement <16 x float> %mfma0, i32 3
  %insert = insertelement <16 x float> %mfma0, float %agpr0, i32 8

  %mfma1 = call <16 x float> @llvm.amdgcn.mfma.f32.16x16x1f32(float %v0, float %v1, <16 x float> %insert, i32 0, i32 0, i32 0)
  %mfma1.3 = extractelement <16 x float> %mfma1, i32 3
  call void asm sideeffect "; use $0", "{a1}"(float %mfma1.3)
  call void asm sideeffect "; use $0", "a"(<16 x float> %agpr.vec)

  ret void
}

declare <16 x float> @llvm.amdgcn.mfma.f32.16x16x1f32(float, float, <16 x float>, i32 immarg, i32 immarg, i32 immarg) #1
declare i32 @llvm.amdgcn.workitem.id.x() #2

attributes #0 = { "amdgpu-waves-per-eu"="10,10" }
attributes #1 = { convergent nounwind readnone willreturn }
attributes #2 = { nounwind readnone speculatable willreturn }