Skip to content

Commit 3b905a0

Browse files
committed
[AMDGPU] ISel for llvm.amdgcn.set.inactive.chain.arg
Add patterns to select int_amdgcn_set_inactive_chain_arg to V_SET_INACTIVE. This could probably use some more testing, but at least for simple cases V_SET_INACTIVE seems to mostly work out of the box. Differential Revision: https://reviews.llvm.org/D158605
1 parent 4f51b2b commit 3b905a0

File tree

3 files changed

+521
-0
lines changed

3 files changed

+521
-0
lines changed

llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4309,6 +4309,7 @@ AMDGPURegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
43094309
case Intrinsic::amdgcn_wqm:
43104310
case Intrinsic::amdgcn_softwqm:
43114311
case Intrinsic::amdgcn_set_inactive:
4312+
case Intrinsic::amdgcn_set_inactive_chain_arg:
43124313
case Intrinsic::amdgcn_permlane64:
43134314
return getDefaultMappingAllVGPR(MI);
43144315
case Intrinsic::amdgcn_cvt_pkrtz:

llvm/lib/Target/AMDGPU/SIInstructions.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ def V_SET_INACTIVE_B64 : VPseudoInstSI <(outs VReg_64:$vdst),
259259
}
260260
} // End Defs = [SCC]
261261

262+
def : GCNPat<(i32 (int_amdgcn_set_inactive_chain_arg i32:$src, i32:$inactive)),
263+
(V_SET_INACTIVE_B32 VGPR_32:$src, VGPR_32:$inactive)>;
264+
265+
def : GCNPat<(i64 (int_amdgcn_set_inactive_chain_arg i64:$src, i64:$inactive)),
266+
(V_SET_INACTIVE_B64 VReg_64:$src, VReg_64:$inactive)>;
267+
262268
let usesCustomInserter = 1, hasSideEffects = 0, mayLoad = 0, mayStore = 0, Uses = [EXEC] in {
263269
def WAVE_REDUCE_UMIN_PSEUDO_U32 : VPseudoInstSI <(outs SGPR_32:$sdst),
264270
(ins VSrc_b32: $src, VSrc_b32:$strategy),

0 commit comments

Comments
 (0)