llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-backend-amdgpu Author: Stanislav Mekhanoshin (rampitec) <details> <summary>Changes</summary> --- Full diff: https://github.com/llvm/llvm-project/pull/244017.diff 2 Files Affected: - (modified) llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp (+3-20) - (modified) llvm/test/CodeGen/AMDGPU/hazard-partial-trans-f16-write-fake16.mir (-4) ``````````diff diff --git a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp index 2598e82fa41eb..37a6e442e213f 100644 --- a/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp +++ b/llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp @@ -4602,24 +4602,11 @@ bool GCNHazardRecognizer::fixTransF16ToPartialVGPRWriteHazard( unsigned Opc = I.getOpcode(); const MCInstrDesc &Desc = TII.get(Opc); - // Note: checking vdst does not work because it is a generic - // OPERAND_REGISTER. - switch ( - Desc.operands()[AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::src0)] - .OperandType) { - case AMDGPU::OPERAND_REG_IMM_BF16: - case AMDGPU::OPERAND_REG_IMM_FP16: - case AMDGPU::OPERAND_REG_IMM_NOINLINE_FP16: - case AMDGPU::OPERAND_REG_INLINE_C_BF16: - case AMDGPU::OPERAND_REG_INLINE_C_FP16: + switch (Desc.operands()[0].OperandType) { + case AMDGPU::OPERAND_REG_BF16: + case AMDGPU::OPERAND_REG_FP16: break; default: - // DPP instructions have VGPR-only src0 with generic OPERAND_REGISTER - // type. The isDPP() check will catch any TRANS opcodes including f32. - // This is suboptimal but shall only affect fake16 compilation because - // of the Def size check below. - if (SIInstrInfo::isDPP(I)) - break; return NoHazardFound; } @@ -4636,10 +4623,6 @@ bool GCNHazardRecognizer::fixTransF16ToPartialVGPRWriteHazard( : NoHazardFound; } - // Bail for any non-16 bit DPP instructions catched in true16 mode. - if (ST.useRealTrue16Insts()) - return NoHazardFound; - // Fake16 case is suboptimal as it checks the whole 32-bit def overlap w/o // analyzing OPSEL bits. return MI->modifiesRegister(Def, nullptr) ? HazardFound : NoHazardFound; diff --git a/llvm/test/CodeGen/AMDGPU/hazard-partial-trans-f16-write-fake16.mir b/llvm/test/CodeGen/AMDGPU/hazard-partial-trans-f16-write-fake16.mir index 46d48b9ac9f0a..ea757f7a9a8f5 100644 --- a/llvm/test/CodeGen/AMDGPU/hazard-partial-trans-f16-write-fake16.mir +++ b/llvm/test/CodeGen/AMDGPU/hazard-partial-trans-f16-write-fake16.mir @@ -126,7 +126,6 @@ body: | $vgpr1 = V_MOV_B16_fake16_e32 0, implicit $exec ... -# FIXME: S_WAITCNT_DEPCTR is not needed for f32 case but we cannot detect it with fake32. --- name: trans_f32_dpp_partial_def_no_hazard tracksRegLiveness: false @@ -135,7 +134,6 @@ body: | ; GCN-LABEL: name: trans_f32_dpp_partial_def_no_hazard ; GCN: $vgpr1 = V_SQRT_F32_dpp $vgpr1, 0, $vgpr0, 1, 15, 15, 1, implicit $mode, implicit $exec ; GCN-NEXT: V_NOP_e32 implicit $exec - ; GCN-NEXT: S_WAITCNT_DEPCTR .VaVdst_0 ; GCN-NEXT: $vgpr1 = V_MOV_B16_fake16_e32 0, implicit $exec $vgpr1 = V_SQRT_F32_dpp $vgpr1, 0, $vgpr0, 1, 15, 15, 1, implicit $mode, implicit $exec $vgpr1 = V_MOV_B16_fake16_e32 0, implicit $exec @@ -154,7 +152,6 @@ body: | $vgpr1 = V_MOV_B16_fake16_e32 0, implicit $exec ... -# FIXME: S_WAITCNT_DEPCTR is not needed for f32 case but we cannot detect it with fake32. --- name: trans_f32_dpp_e64_partial_def_no_hazard tracksRegLiveness: false @@ -163,7 +160,6 @@ body: | ; GCN-LABEL: name: trans_f32_dpp_e64_partial_def_no_hazard ; GCN: $vgpr1 = V_SQRT_F32_e64_dpp $vgpr1, 0, $vgpr0, 0, 0, 1, 15, 15, 1, implicit $mode, implicit $exec ; GCN-NEXT: V_NOP_e32 implicit $exec - ; GCN-NEXT: S_WAITCNT_DEPCTR .VaVdst_0 ; GCN-NEXT: $vgpr1 = V_MOV_B16_fake16_e32 0, implicit $exec $vgpr1 = V_SQRT_F32_e64_dpp $vgpr1, 0, $vgpr0, 0, 0, 1, 15, 15, 1, implicit $mode, implicit $exec $vgpr1 = V_MOV_B16_fake16_e32 0, implicit $exec `````````` </details> https://github.com/llvm/llvm-project/pull/244017 _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
