Skip to content

Commit 208cfa0

Browse files
committed
Revert "Revert "[AMDGPU] Precommit lit test for llvm#72140.""
This reverts commit b633543. Change-Id: I4a7a15860efda59187e1daefd31eca806909c762
1 parent 28d5999 commit 208cfa0

File tree

5 files changed

+617
-6
lines changed

5 files changed

+617
-6
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8923,8 +8923,16 @@ unsigned SIInstrInfo::getLiveRangeSplitOpcode(Register SrcReg,
89238923
}
89248924

89258925
bool SIInstrInfo::isBasicBlockPrologue(const MachineInstr &MI) const {
8926-
return !MI.isTerminator() && MI.getOpcode() != AMDGPU::COPY &&
8927-
MI.modifiesRegister(AMDGPU::EXEC, &RI);
8926+
// We need to handle instructions which may be inserted during register
8927+
// allocation to handle the prolog. The initial prolog instruction may have
8928+
// been separated from the start of the block by spills and copies inserted
8929+
// needed by the prolog.
8930+
uint16_t Opc = MI.getOpcode();
8931+
8932+
// FIXME: Copies inserted in the block prolog for live-range split should also
8933+
// be included.
8934+
return (isSpillOpcode(Opc) || (!MI.isTerminator() && Opc != AMDGPU::COPY &&
8935+
MI.modifiesRegister(AMDGPU::EXEC, &RI)));
89288936
}
89298937

89308938
MachineInstrBuilder

llvm/test/CodeGen/AMDGPU/GlobalISel/image-waterfall-loop-O0.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ define <4 x float> @waterfall_loop(<8 x i32> %vgpr_srd) {
144144
; CHECK-NEXT: buffer_store_dword v0, off, s[0:3], s32 ; 4-byte Folded Spill
145145
; CHECK-NEXT: s_mov_b32 exec_lo, s21
146146
; CHECK-NEXT: ; %bb.2: ; in Loop: Header=BB0_1 Depth=1
147-
; CHECK-NEXT: buffer_load_dword v0, off, s[0:3], s32 offset:4 ; 4-byte Folded Reload
148-
; CHECK-NEXT: buffer_load_dword v1, off, s[0:3], s32 offset:8 ; 4-byte Folded Reload
149147
; CHECK-NEXT: s_or_saveexec_b32 s21, -1
150148
; CHECK-NEXT: buffer_load_dword v2, off, s[0:3], s32 ; 4-byte Folded Reload
151149
; CHECK-NEXT: s_mov_b32 exec_lo, s21
@@ -163,6 +161,9 @@ define <4 x float> @waterfall_loop(<8 x i32> %vgpr_srd) {
163161
; CHECK-NEXT: v_readlane_b32 s17, v2, 1
164162
; CHECK-NEXT: v_readlane_b32 s18, v2, 2
165163
; CHECK-NEXT: v_readlane_b32 s19, v2, 3
164+
; CHECK-NEXT: buffer_load_dword v0, off, s[0:3], s32 offset:4 ; 4-byte Folded Reload
165+
; CHECK-NEXT: buffer_load_dword v1, off, s[0:3], s32 offset:8 ; 4-byte Folded Reload
166+
; CHECK-NEXT: s_waitcnt vmcnt(0)
166167
; CHECK-NEXT: image_sample v0, v[0:1], s[8:15], s[16:19] dmask:0x1 dim:SQ_RSRC_IMG_2D
167168
; CHECK-NEXT: s_waitcnt vmcnt(0)
168169
; CHECK-NEXT: buffer_store_dword v0, off, s[0:3], s32 offset:76 ; 4-byte Folded Spill

llvm/test/CodeGen/AMDGPU/control-flow-fastregalloc.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
; XFAIL: *
21
; RUN: llc -O0 -mtriple=amdgcn--amdhsa -amdgpu-spill-sgpr-to-vgpr=0 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=VMEM -check-prefix=GCN %s
32
; RUN: llc -O0 -mtriple=amdgcn--amdhsa -amdgpu-spill-sgpr-to-vgpr=1 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=VGPR -check-prefix=GCN %s
43

llvm/test/CodeGen/AMDGPU/cross-block-use-is-not-abi-copy.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ define { i32, half } @call_split_type_used_outside_block_struct() #0 {
149149
; GCN-NEXT: s_addc_u32 s17, s17, func_struct@rel32@hi+12
150150
; GCN-NEXT: s_swappc_b64 s[30:31], s[16:17]
151151
; GCN-NEXT: v_readlane_b32 s30, v40, 0
152-
; GCN-NEXT: v_mov_b32_e32 v1, v4
153152
; GCN-NEXT: v_readlane_b32 s31, v40, 1
153+
; GCN-NEXT: v_mov_b32_e32 v1, v4
154154
; GCN-NEXT: v_readlane_b32 s4, v40, 2
155155
; GCN-NEXT: s_or_saveexec_b64 s[6:7], -1
156156
; GCN-NEXT: buffer_load_dword v40, off, s[0:3], s33 ; 4-byte Folded Reload

0 commit comments

Comments
 (0)