@@ -1894,7 +1894,6 @@ void SIFrameLowering::determineCalleeSavesSGPR(MachineFunction &MF,
18941894
18951895static void assignSlotsUsingVGPRBlocks (MachineFunction &MF,
18961896 const GCNSubtarget &ST,
1897- const TargetRegisterInfo *TRI,
18981897 std::vector<CalleeSavedInfo> &CSI,
18991898 unsigned &MinCSFrameIndex,
19001899 unsigned &MaxCSFrameIndex) {
@@ -1921,8 +1920,8 @@ static void assignSlotsUsingVGPRBlocks(MachineFunction &MF,
19211920 if (!CanUseBlockOps (*CSIt))
19221921 continue ;
19231922
1924- // Find all the regs that will fit in a 32-bit block starting at the current
1925- // reg and build the mask. It should have 1 for every register that's
1923+ // Find all the regs that will fit in a 32-bit mask starting at the current
1924+ // reg and build said mask. It should have 1 for every register that's
19261925 // included, with the current register as the least significant bit.
19271926 uint32_t Mask = 1 ;
19281927 CSEnd = std::remove_if (
@@ -1935,8 +1934,7 @@ static void assignSlotsUsingVGPRBlocks(MachineFunction &MF,
19351934 }
19361935 });
19371936
1938- const TargetRegisterClass *BlockRegClass =
1939- TII->getRegClassForBlockOp (TRI, MF);
1937+ const TargetRegisterClass *BlockRegClass = &AMDGPU::VReg_1024RegClass;
19401938 Register RegBlock =
19411939 MRI->getMatchingSuperReg (Reg, AMDGPU::sub0, BlockRegClass);
19421940 if (!RegBlock) {
@@ -1990,8 +1988,7 @@ bool SIFrameLowering::assignCalleeSavedSpillSlots(
19901988 bool UseVGPRBlocks = ST.useVGPRBlockOpsForCSR ();
19911989
19921990 if (UseVGPRBlocks)
1993- assignSlotsUsingVGPRBlocks (MF, ST, TRI, CSI, MinCSFrameIndex,
1994- MaxCSFrameIndex);
1991+ assignSlotsUsingVGPRBlocks (MF, ST, CSI, MinCSFrameIndex, MaxCSFrameIndex);
19951992
19961993 return assignCalleeSavedSpillSlots (MF, TRI, CSI);
19971994}
@@ -2152,10 +2149,10 @@ bool SIFrameLowering::restoreCalleeSavedRegisters(
21522149 // VGPRs in the register block is reserved (e.g. if it's a WWM register),
21532150 // then the whole block will be marked as reserved and `updateLiveness` will
21542151 // skip it.
2155- if (!MBB.isLiveIn (Reg))
2156- MBB.addLiveIn (Reg);
2152+ MBB.addLiveIn (Reg);
21572153 }
21582154
2155+ MBB.sortUniqueLiveIns ();
21592156 return false ;
21602157}
21612158
0 commit comments