Skip to content

Commit 552e220

Browse files
committed
Fix bug in testcase
1 parent 80e6433 commit 552e220

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

llvm/lib/Target/AMDGPU/SIFrameLowering.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,10 @@ void SIFrameLowering::emitCSRSpillStores(
10271027
// it now. If we have already saved some WWM CSR registers, then the EXEC is
10281028
// already -1 and we don't need to do anything else. Otherwise, set EXEC to
10291029
// -1 here.
1030-
if (WWMCalleeSavedRegs.empty())
1030+
if (!ScratchExecCopy)
1031+
buildScratchExecCopy(LiveUnits, MF, MBB, MBBI, DL, /*IsProlog*/ true,
1032+
/*EnableInactiveLanes*/ true);
1033+
else if (WWMCalleeSavedRegs.empty())
10311034
EnableAllLanes();
10321035
TII->getWholeWaveFunctionSetup(MF)->eraseFromParent();
10331036
} else if (ScratchExecCopy) {

llvm/test/CodeGen/AMDGPU/whole-wave-functions-pei.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ body: |
360360
; CHECK-LABEL: name: dont_restore_used_vgprs
361361
; CHECK: liveins: $vgpr0, $vgpr20, $vgpr40
362362
; CHECK-NEXT: {{ $}}
363-
; CHECK-NEXT: $exec_lo = S_MOV_B32 -1
363+
; CHECK-NEXT: $sgpr0 = S_XOR_SAVEEXEC_B32 -1, implicit-def $exec, implicit-def dead $scc, implicit $exec
364364
; CHECK-NEXT: S_NOP 0, implicit $vgpr0, implicit $vgpr20, implicit $vgpr40
365365
; CHECK-NEXT: $exec_lo = S_MOV_B32 $sgpr0
366366
; CHECK-NEXT: SI_WHOLE_WAVE_FUNC_RETURN killed renamable $sgpr0, implicit killed $vgpr0

0 commit comments

Comments
 (0)