llvm-project
4f792b8a - [AMDGPU] Handle gfx950 v_pk_{add,mul,fma}_f32 invalid op_sel (#231506)

Commit
38 days ago
[AMDGPU] Handle gfx950 v_pk_{add,mul,fma}_f32 invalid op_sel (#231506) gfx950 v_pk_add/mul/fma_f32 for certain op_sel combinations: - Case 1 (v_pk_add/mul_f32): src0/src1 both VGPR with op_sel[1:0] == 2'b10. Adjusted in GCNHazardRecognizer::fixPkF32InvalidOpSel by commuting src0/src1 in place. - Case 2/3 (v_pk_fma_f32): op_sel[2:1] == 2'b01, 2'b10, or 2'b11. Fixed via SIInstrInfo::decomposePkFMAF32, which splits the packed FMA into two independent scalar v_fma_f32s; wired in from both SIInstrInfo::legalizeOperandsVOP3 (SelectionDAG) and AMDGPUInstructionSelector::select's G_FMA case (GlobalISel), both gated on SIInstrInfo::isLegalPkFMAF32OpSel. A safety net that crashes the compiler is added in GCNHazardRecognizer::fixPkF32InvalidOpSel. Also reject the invalid op_sel encodings directly in the assembler (AMDGPUAsmParser::validateOpSel) so hand-written/inline asm can't encode them.
Author
Parents
Loading