Skip to content

Commit 8d19d36

Browse files
committed
added an assert for scratch flat
1 parent 8c76963 commit 8d19d36

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,6 +2395,7 @@ bool SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
23952395

23962396
unsigned Opc;
23972397
if (MI->getOpcode() == AMDGPU::SI_SPILL_V16_SAVE) {
2398+
assert(ST.enableFlatScratch() && "Flat Scratch is not enabled!");
23982399
Opc = AMDGPU::SCRATCH_STORE_SHORT_SADDR_t16;
23992400
} else {
24002401
Opc = ST.enableFlatScratch() ? AMDGPU::SCRATCH_STORE_DWORD_SADDR
@@ -2470,6 +2471,7 @@ bool SIRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI,
24702471

24712472
unsigned Opc;
24722473
if (MI->getOpcode() == AMDGPU::SI_SPILL_V16_RESTORE) {
2474+
assert(ST.enableFlatScratch() && "Flat Scratch is not enabled!");
24732475
Opc = AMDGPU::SCRATCH_LOAD_SHORT_D16_SADDR_t16;
24742476
} else {
24752477
Opc = ST.enableFlatScratch() ? AMDGPU::SCRATCH_LOAD_DWORD_SADDR

0 commit comments

Comments
 (0)