mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
R600/SI: Use s_movk_i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -189,6 +189,19 @@ bool SIShrinkInstructions::runOnMachineFunction(MachineFunction &MF) {
|
||||
Next = std::next(I);
|
||||
MachineInstr &MI = *I;
|
||||
|
||||
// Try to use S_MOVK_I32, which will save 4 bytes for small immediates.
|
||||
if (MI.getOpcode() == AMDGPU::S_MOV_B32) {
|
||||
const MachineOperand &Src = MI.getOperand(1);
|
||||
|
||||
// TODO: Handle FPImm?
|
||||
if (Src.isImm()) {
|
||||
if (isInt<16>(Src.getImm()) && !TII->isInlineConstant(Src)) {
|
||||
MI.setDesc(TII->get(AMDGPU::S_MOVK_I32));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!TII->hasVALU32BitEncoding(MI.getOpcode()))
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user