Skip to content

Commit 4f358d7

Browse files
[amdgpu][nfc] Post-commit feedback on c39fba2
1 parent 439bef9 commit 4f358d7

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
@@ -2366,7 +2366,7 @@ bool SIInstrInfo::expandPostRAPseudo(MachineInstr &MI) const {
23662366
assert(ST.useVGPRIndexMode());
23672367
Register VecReg = MI.getOperand(0).getReg();
23682368
bool IsUndef = MI.getOperand(1).isUndef();
2369-
MachineOperand Idx = MI.getOperand(3);
2369+
MachineOperand &Idx = MI.getOperand(3);
23702370
Register SubReg = MI.getOperand(4).getImm();
23712371

23722372
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)