1# RUN: llc -o - %s -mtriple=amdgcn-- -mcpu=fiji -verify-machineinstrs -run-pass=greedy,virtregrewriter | FileCheck %s 2--- | 3 define void @func0() #0 { ret void } 4 define void @func1() #0 { ret void } 5 6 attributes #0 = { "amdgpu-num-sgpr"="12" } 7... 8--- 9# Make sure we only get a single spill+reload even if liverange splitting 10# created a sequence of multiple copy instructions. 11# CHECK-LABEL: name: func0 12# CHECK: SI_SPILL_S128_SAVE 13# CHECK-NOT: SI_SPILL_S128_SAVE 14# CHECK: S_NOP 0 15# CHECK: SI_SPILL_S128_RESTORE 16# CHECK-NOT: SI_SPILL_S128_RESTORE 17name: func0 18body: | 19 bb.0: 20 S_NOP 0, implicit-def undef %0.sub0 : sreg_128 21 S_NOP 0, implicit-def %0.sub3 : sreg_128 22 23 ; Clobber registers 24 S_NOP 0, implicit-def dead %sgpr0, implicit-def dead %sgpr1, implicit-def dead %sgpr2, implicit-def dead %sgpr3, implicit-def dead %sgpr4, implicit-def dead %sgpr5, implicit-def dead %sgpr6, implicit-def dead %sgpr7, implicit-def dead %sgpr8, implicit-def dead %sgpr9, implicit-def dead %sgpr10, implicit-def dead %sgpr11 25 26 S_NOP 0, implicit %0.sub0 27 S_NOP 0, implicit %0.sub3 28 S_NOP 0, implicit %0.sub0 29 S_NOP 0, implicit %0.sub3 30... 31--- 32# LiveRange splitting should split this into 2 intervals with the second getting 33# allocated to sgpr0_sgpr1 and the first to something else so we see two copies 34# in between for the two subregisters that are alive. 35# CHECK-LABEL: name: func1 36# CHECK: [[REG0:%sgpr[0-9]+]] = COPY %sgpr0 37# CHECK: [[REG1:%sgpr[0-9]+]] = COPY %sgpr2 38# CHECK: S_NOP 0 39# CHECK: S_NOP 0, implicit [[REG0]] 40# CHECK: S_NOP 0, implicit [[REG1]] 41# CHECK: %sgpr0 = COPY [[REG0]] 42# CHECK: %sgpr2 = COPY [[REG1]] 43# CHECK: S_NOP 44# CHECK: S_NOP 0, implicit %sgpr0 45# CHECK: S_NOP 0, implicit %sgpr2 46name: func1 47tracksRegLiveness: true 48body: | 49 bb.0: 50 liveins: %sgpr0, %sgpr1, %sgpr2 51 undef %0.sub0 : sreg_128 = COPY %sgpr0 52 %0.sub2 = COPY %sgpr2 53 54 S_NOP 0, implicit-def dead %sgpr0, implicit-def dead %sgpr1 55 56 S_NOP 0, implicit %0.sub0 57 S_NOP 0, implicit %0.sub2 58 59 ; Clobber everything but sgpr0-sgpr3 60 S_NOP 0, implicit-def dead %sgpr4, implicit-def dead %sgpr5, implicit-def dead %sgpr6, implicit-def dead %sgpr7, implicit-def dead %sgpr8, implicit-def dead %sgpr9, implicit-def dead %sgpr10, implicit-def dead %sgpr11, implicit-def dead %sgpr12, implicit-def dead %sgpr13, implicit-def dead %sgpr14, implicit-def dead %sgpr15, implicit-def dead %vcc_lo, implicit-def dead %vcc_hi 61 62 S_NOP 0, implicit %0.sub0 63 S_NOP 0, implicit %0.sub2 64... 65