Skip to content

Commit

Permalink
AMDGPU/GlobalISel: Allow scc/vcc alternative mappings for s1 constants
Browse files Browse the repository at this point in the history
llvm-svn: 373295
  • Loading branch information
arsenm committed Oct 1, 2019
1 parent bdcc6d3 commit 5823a28
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,21 @@ AMDGPURegisterBankInfo::getInstrAlternativeMappings(

InstructionMappings AltMappings;
switch (MI.getOpcode()) {
case TargetOpcode::G_CONSTANT:
case TargetOpcode::G_CONSTANT: {
unsigned Size = getSizeInBits(MI.getOperand(0).getReg(), MRI, *TRI);
if (Size == 1) {
static const OpRegBankEntry<1> Table[4] = {
{ { AMDGPU::VGPRRegBankID }, 1 },
{ { AMDGPU::SGPRRegBankID }, 1 },
{ { AMDGPU::VCCRegBankID }, 1 },
{ { AMDGPU::SCCRegBankID }, 1 }
};

return addMappingFromTable<1>(MI, MRI, { 0 }, Table);
}

LLVM_FALLTHROUGH;
}
case TargetOpcode::G_FCONSTANT:
case TargetOpcode::G_FRAME_INDEX:
case TargetOpcode::G_GLOBAL_VALUE: {
Expand Down

0 comments on commit 5823a28

Please sign in to comment.