Skip to content

Commit

Permalink
[AMDGPU][GlobalISel] Select wqm.demote and wqm.helper intrinsics
Browse files Browse the repository at this point in the history
Map and select amdgcn_wqm_demote and amdgcn_wqm_helper intrinsics for GlobalISel

Change-Id: I92c30f230d8fcf5973670f4aa41e800fb2569b41
  • Loading branch information
mbrkusanin committed Aug 27, 2020
1 parent 7189d5e commit fbf8174
Show file tree
Hide file tree
Showing 3 changed files with 1,282 additions and 2 deletions.
5 changes: 5 additions & 0 deletions llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4324,10 +4324,15 @@ AMDGPURegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
OpdsMapping[3] = AMDGPU::getValueMapping(AMDGPU::SGPRRegBankID, WaveSize);
break;
}
case Intrinsic::amdgcn_wqm_demote:
case Intrinsic::amdgcn_kill: {
OpdsMapping[1] = AMDGPU::getValueMapping(AMDGPU::VCCRegBankID, 1);
break;
}
case Intrinsic::amdgcn_wqm_helper: {
OpdsMapping[0] = AMDGPU::getValueMapping(AMDGPU::VCCRegBankID, 1);
break;
}
case Intrinsic::amdgcn_raw_buffer_load:
case Intrinsic::amdgcn_raw_atomic_buffer_load:
case Intrinsic::amdgcn_raw_tbuffer_load: {
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AMDGPU/SIInstructions.td
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,12 @@ def : Pat <

def : Pat <
(int_amdgcn_wqm_demote i1:$src),
(SI_DEMOTE_I1 $src, 0)
(SI_DEMOTE_I1 SCSrc_i1:$src, 0)
>;

def : Pat <
(int_amdgcn_wqm_demote (i1 (not i1:$src))),
(SI_DEMOTE_I1 $src, -1)
(SI_DEMOTE_I1 SCSrc_i1:$src, -1)
>;

def : Pat <
Expand Down
Loading

0 comments on commit fbf8174

Please sign in to comment.