Skip to content

Commit 60bf26c

Browse files
JonChesterfieldDavid Salinas
authored andcommitted
[amdgpu][nfc] Post-commit feedback on c39fba2
1 parent 3600741 commit 60bf26c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2420,7 +2420,7 @@ bool SIInstrInfo::expandPostRAPseudo(MachineInstr &MI) const {
24202420
assert(ST.useVGPRIndexMode());
24212421
Register VecReg = MI.getOperand(0).getReg();
24222422
bool IsUndef = MI.getOperand(1).isUndef();
2423-
MachineOperand Idx = MI.getOperand(3);
2423+
MachineOperand &Idx = MI.getOperand(3);
24242424
Register SubReg = MI.getOperand(4).getImm();
24252425

24262426
MachineInstr *SetOn = BuildMI(MBB, MI, DL, get(AMDGPU::S_SET_GPR_IDX_ON))

llvm/test/CodeGen/AMDGPU/copy-to-reg-frameindex.ll

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc < %s -mtriple=amdgcn -mcpu=gfx90a -verify-machineinstrs | FileCheck %s
2+
; RUN: llc < %s -mtriple=amdgcn -mcpu=gfx90a | FileCheck %s
33

44
define amdgpu_kernel void @copy_to_reg_frameindex(ptr addrspace(1) %out, i32 %a, i32 %b, i32 %c) {
55
; CHECK-LABEL: copy_to_reg_frameindex:
@@ -20,19 +20,18 @@ define amdgpu_kernel void @copy_to_reg_frameindex(ptr addrspace(1) %out, i32 %a,
2020
; CHECK-NEXT: s_endpgm
2121
entry:
2222
%B = srem i32 %c, -1
23-
%alloca = alloca [16 x i32], align 4, addrspace(5)
2423
br label %loop
2524

2625
loop:
26+
%promotealloca = phi <16 x i32> [ undef, %entry ], [ %0, %loop ]
2727
%inc = phi i32 [ 0, %entry ], [ %inc.i, %loop ]
28-
%ptr = getelementptr [16 x i32], ptr addrspace(5) %alloca, i32 0, i32 %inc
29-
store i32 %inc, ptr addrspace(5) %ptr, align 4
28+
%0 = insertelement <16 x i32> %promotealloca, i32 %inc, i32 %inc
3029
%inc.i = add i32 %inc, %B
3130
%cnd = icmp uge i32 %inc.i, 16
3231
br i1 %cnd, label %done, label %loop
3332

3433
done:
35-
%tmp1 = load i32, ptr addrspace(5) %alloca, align 4
36-
store i32 %tmp1, ptr addrspace(1) %out, align 4
34+
%1 = extractelement <16 x i32> %0, i32 0
35+
store i32 %1, ptr addrspace(1) %out, align 4
3736
ret void
3837
}

0 commit comments

Comments
 (0)