588 : ST(&_ST), MRI(&_MRI) {
590 addRulesForGOpcs({G_ADD, G_SUB},
Standard)
602 addRulesForGOpcs({G_UADDO, G_USUBO},
Standard)
606 addRulesForGOpcs({G_UADDE, G_USUBE, G_SADDE, G_SSUBE},
Standard)
610 addRulesForGOpcs({G_UADDSAT, G_SADDSAT, G_USUBSAT, G_SSUBSAT},
Standard)
618 bool UseVecMulU64 = ST->useVMulU64Inst();
630 bool hasMulHi = ST->hasScalarMulHiInsts();
631 addRulesForGOpcs({G_UMULH, G_SMULH},
Standard)
636 addRulesForGOpcs({G_AMDGPU_MAD_U64_U32},
Standard)
640 bool HasScalarSMulU64 = ST->hasScalarSMulU64();
641 addRulesForGOpcs({G_AMDGPU_S_MUL_U64_U32, G_AMDGPU_S_MUL_I64_I32},
Standard)
645 addRulesForGOpcs({G_XOR, G_OR, G_AND},
StandardB)
665 addRulesForGOpcs({G_LSHR},
Standard)
675 addRulesForGOpcs({G_ASHR},
Standard)
685 addRulesForGOpcs({G_FSHR},
Standard)
689 addRulesForGOpcs({G_BSWAP},
Standard)
697 addRulesForGOpcs({G_AMDGPU_CVT_F32_UBYTE0, G_AMDGPU_CVT_F32_UBYTE1,
698 G_AMDGPU_CVT_F32_UBYTE2, G_AMDGPU_CVT_F32_UBYTE3,
706 addRulesForGOpcs({G_UBFX, G_SBFX},
Standard)
712 addRulesForGOpcs({G_SMIN, G_SMAX},
Standard)
722 addRulesForGOpcs({G_UMIN, G_UMAX},
Standard)
732 addRulesForGOpcs({G_IMPLICIT_DEF})
737 addRulesForGOpcs({G_CONSTANT},
Standard)
745 addRulesForGOpcs({G_FCONSTANT},
Standard)
750 addRulesForGOpcs({G_FREEZE})
757 addRulesForGOpcs({G_BITCAST})
763 addRulesForGOpcs({G_UNMERGE_VALUES})
768 addRulesForGOpcs({G_BUILD_VECTOR, G_MERGE_VALUES})
774 addRulesForGOpcs({G_CONCAT_VECTORS})
778 addRulesForGOpcs({G_PHI})
784 addRulesForGOpcs({G_EXTRACT_VECTOR_ELT})
795 addRulesForGOpcs({G_INSERT_VECTOR_ELT})
811 addRulesForGOpcs({G_AMDGPU_BVH_INTERSECT_RAY, G_AMDGPU_BVH_DUAL_INTERSECT_RAY,
812 G_AMDGPU_BVH8_INTERSECT_RAY})
819 addRulesForGOpcs({G_AMDGPU_INTRIN_IMAGE_LOAD, G_AMDGPU_INTRIN_IMAGE_LOAD_D16,
820 G_AMDGPU_INTRIN_IMAGE_LOAD_NORET,
821 G_AMDGPU_INTRIN_IMAGE_STORE,
822 G_AMDGPU_INTRIN_IMAGE_STORE_D16})
837 bool HasScalarCompareEq64 = ST->hasScalarCompareEq64();
839 addRulesForGOpcs({G_ICMP})
858 addRulesForGOpcs({G_BRCOND})
862 addRulesForGOpcs({G_BR}).
Any({{
_}, {{}, {
None}}});
872 addRulesForGOpcs({G_ANYEXT})
886 bool Has16bitCmp = ST->has16BitInsts();
893 addRulesForGOpcs({G_TRUNC})
909 addRulesForGOpcs({G_ZEXT})
924 addRulesForGOpcs({G_SEXT})
939 addRulesForGOpcs({G_SEXT_INREG})
945 addRulesForGOpcs({G_ASSERT_ZEXT, G_ASSERT_SEXT},
Standard)
951 addRulesForGOpcs({G_ASSERT_ALIGN},
Standard)
963 addRulesForGOpcs({G_ATOMICRMW_ADD, G_ATOMICRMW_SUB, G_ATOMICRMW_XCHG,
964 G_ATOMICRMW_AND, G_ATOMICRMW_OR, G_ATOMICRMW_XOR,
965 G_ATOMICRMW_MIN, G_ATOMICRMW_MAX, G_ATOMICRMW_UMIN,
966 G_ATOMICRMW_UMAX, G_ATOMICRMW_UINC_WRAP,
967 G_ATOMICRMW_UDEC_WRAP, G_ATOMICRMW_FMIN, G_ATOMICRMW_FMAX})
975 addRulesForGOpcs({G_ATOMICRMW_USUB_SAT, G_ATOMICRMW_USUB_COND})
980 bool HasAtomicFlatPkAdd16Insts = ST->hasAtomicFlatPkAdd16Insts();
981 bool HasAtomicBufferGlobalPkAddF16Insts =
982 ST->hasAtomicBufferGlobalPkAddF16NoRtnInsts() ||
983 ST->hasAtomicBufferGlobalPkAddF16Insts();
984 bool HasAtomicDsPkAdd16Insts = ST->hasAtomicDsPkAdd16Insts();
985 addRulesForGOpcs({G_ATOMICRMW_FADD})
993 HasAtomicFlatPkAdd16Insts)
995 HasAtomicBufferGlobalPkAddF16Insts)
997 HasAtomicDsPkAdd16Insts);
999 addRulesForGOpcs({G_ATOMIC_CMPXCHG})
1005 addRulesForGOpcs({G_AMDGPU_ATOMIC_CMPXCHG})
1011 addRulesForGOpcs({G_AMDGPU_BUFFER_ATOMIC_CMPSWAP},
Standard)
1017 addRulesForGOpcs({G_AMDGPU_BUFFER_ATOMIC_ADD, G_AMDGPU_BUFFER_ATOMIC_AND,
1018 G_AMDGPU_BUFFER_ATOMIC_DEC, G_AMDGPU_BUFFER_ATOMIC_FMAX,
1019 G_AMDGPU_BUFFER_ATOMIC_FMIN, G_AMDGPU_BUFFER_ATOMIC_INC,
1020 G_AMDGPU_BUFFER_ATOMIC_OR, G_AMDGPU_BUFFER_ATOMIC_SMAX,
1021 G_AMDGPU_BUFFER_ATOMIC_SMIN, G_AMDGPU_BUFFER_ATOMIC_SUB,
1022 G_AMDGPU_BUFFER_ATOMIC_SWAP, G_AMDGPU_BUFFER_ATOMIC_UMAX,
1023 G_AMDGPU_BUFFER_ATOMIC_UMIN, G_AMDGPU_BUFFER_ATOMIC_XOR},
1028 bool hasSMRDx3 = ST->hasScalarDwordx3Loads();
1029 bool hasSMRDSmall = ST->hasScalarSubwordLoads();
1030 bool usesTrue16 = ST->useRealTrue16Insts();
1033 return (*
MI.memoperands_begin())->getAlign() >=
Align(16);
1037 return (*
MI.memoperands_begin())->getAlign() >=
Align(4);
1041 return (*
MI.memoperands_begin())->isAtomic();
1057 return (*
MI.memoperands_begin())->isVolatile();
1061 return (*
MI.memoperands_begin())->isInvariant();
1076 return MemSize == 16 || MemSize == 8;
1084 auto isUL = !isAtomicMMO && isUniMMO && (isConst || !isVolatileMMO) &&
1085 (isConst || isInvMMO || isNoClobberMMO);
1089 addRulesForGOpcs({G_LOAD})
1196 addRulesForGOpcs({G_ZEXTLOAD, G_SEXTLOAD})
1227 addRulesForGOpcs({G_STORE})
1263 addRulesForGOpcs({G_AMDGPU_BUFFER_LOAD, G_AMDGPU_BUFFER_LOAD_FORMAT,
1264 G_AMDGPU_TBUFFER_LOAD_FORMAT},
1275 addRulesForGOpcs({G_AMDGPU_BUFFER_LOAD_USHORT, G_AMDGPU_BUFFER_LOAD_UBYTE,
1276 G_AMDGPU_BUFFER_LOAD_SSHORT, G_AMDGPU_BUFFER_LOAD_SBYTE},
1282 {G_AMDGPU_BUFFER_LOAD_UBYTE_TFE, G_AMDGPU_BUFFER_LOAD_USHORT_TFE},
1287 addRulesForGOpcs({G_AMDGPU_BUFFER_LOAD_TFE, G_AMDGPU_BUFFER_LOAD_FORMAT_TFE,
1288 G_AMDGPU_BUFFER_LOAD_FORMAT_D16_TFE},
1301 {G_AMDGPU_BUFFER_LOAD_FORMAT_D16, G_AMDGPU_TBUFFER_LOAD_FORMAT_D16},
1310 addRulesForGOpcs({G_AMDGPU_S_BUFFER_LOAD})
1360 addRulesForGOpcs({G_AMDGPU_S_BUFFER_LOAD_SBYTE, G_AMDGPU_S_BUFFER_LOAD_UBYTE,
1361 G_AMDGPU_S_BUFFER_LOAD_SSHORT,
1362 G_AMDGPU_S_BUFFER_LOAD_USHORT})
1371 addRulesForGOpcs({G_AMDGPU_BUFFER_STORE, G_AMDGPU_BUFFER_STORE_BYTE,
1372 G_AMDGPU_BUFFER_STORE_SHORT, G_AMDGPU_BUFFER_STORE_FORMAT,
1373 G_AMDGPU_BUFFER_STORE_FORMAT_D16,
1374 G_AMDGPU_TBUFFER_STORE_FORMAT,
1375 G_AMDGPU_TBUFFER_STORE_FORMAT_D16})
1387 addRulesForGOpcs({G_AMDGPU_BUFFER_ATOMIC_FADD})
1396 addRulesForGOpcs({G_PTR_ADD})
1402 addRulesForGOpcs({G_INTTOPTR})
1410 addRulesForGOpcs({G_PTRTOINT})
1420 addRulesForGOpcs({G_PTRMASK})
1426 addRulesForGOpcs({G_DYN_STACKALLOC})
1430 addRulesForGOpcs({G_ABS},
Standard)
1438 addRulesForGOpcs({G_BITREVERSE},
Standard)
1444 addRulesForGOpcs({G_AMDGPU_FFBH_U32, G_AMDGPU_FFBL_B32, G_CTLZ_ZERO_POISON,
1445 G_CTTZ_ZERO_POISON})
1451 addRulesForGOpcs({G_CTPOP})
1457 addRulesForGOpcs({G_FENCE}).
Any({{{}}, {{}, {}}});
1459 addRulesForGOpcs({G_READSTEADYCOUNTER, G_READCYCLECOUNTER},
Standard)
1462 addRulesForGOpcs({G_GET_ROUNDING},
Standard)
1465 addRulesForGOpcs({G_SET_ROUNDING},
Standard)
1471 addRulesForGOpcs({G_GLOBAL_VALUE})
1478 addRulesForGOpcs({G_AMDGPU_WAVE_ADDRESS}).
Any({{
UniP5}, {{
SgprP5}, {}}});
1482 addRulesForGOpcs({G_SI_CALL})
1488 bool hasSALUFloat = ST->hasSALUFloatInsts();
1490 addRulesForGOpcs({G_FADD, G_FMUL, G_STRICT_FADD, G_STRICT_FMUL},
Standard)
1506 addRulesForGOpcs({G_FSUB, G_STRICT_FSUB},
Standard)
1516 addRulesForGOpcs({G_FMAD},
Standard)
1522 addRulesForGOpcs({G_FLDEXP, G_STRICT_FLDEXP},
Standard)
1530 addRulesForGOpcs({G_FMA, G_STRICT_FMA},
Standard)
1546 addRulesForGOpcs({G_AMDGPU_FMED3},
Standard)
1555 addRulesForGOpcs({G_AMDGPU_SMED3},
Standard)
1563 addRulesForGOpcs({G_FNEG, G_FABS},
Standard)
1577 addRulesForGOpcs({G_FCANONICALIZE},
Standard)
1591 bool hasPST = ST->hasPseudoScalarTrans();
1594 addRulesForGOpcs({G_FSQRT})
1600 addRulesForGOpcs({G_FPTOUI, G_FPTOSI, G_FPTOUI_SAT, G_FPTOSI_SAT})
1617 addRulesForGOpcs({G_UITOFP, G_SITOFP})
1629 addRulesForGOpcs({G_AMDGPU_S_BUFFER_PREFETCH})
1634 return MI.getOperand(3).getImm() != 0;
1637 bool HasSMemPF = ST->hasSafeSmemPrefetch();
1638 bool HasVMemPF = ST->hasVmemPrefInsts();
1639 addRulesForGOpcs({G_PREFETCH})
1645 !HasSMemPF && !HasVMemPF)
1657 addRulesForGOpcs({G_FPEXT})
1664 addRulesForGOpcs({G_AMDGPU_CVT_PK_I16_I32},
Standard)
1668 addRulesForGOpcs({G_AMDGPU_FMIN_LEGACY, G_AMDGPU_FMAX_LEGACY},
Standard)
1672 bool hasSALUMinimumMaximumInsts = ST->hasSALUMinimumMaximumInsts();
1674 addRulesForGOpcs({G_FMINIMUM, G_FMAXIMUM},
Standard)
1686 addRulesForGOpcs({G_FMINNUM_IEEE, G_FMAXNUM_IEEE, G_FMINNUM, G_FMAXNUM,
1687 G_FMINIMUMNUM, G_FMAXIMUMNUM},
1700 addRulesForGOpcs({G_FPTRUNC})
1709 addRulesForGOpcs({G_INTRINSIC_FPTRUNC_ROUND})
1718 addRulesForGOpcs({G_IS_FPCLASS})
1726 addRulesForGOpcs({G_FCMP},
Standard)
1740 addRulesForGOpcs({G_INTRINSIC_ROUNDEVEN, G_FEXP2, G_FLOG2},
Standard)
1748 addRulesForGOpcs({G_INTRINSIC_TRUNC, G_FFLOOR, G_FCEIL},
Standard)
1758 addRulesForGOpcs({G_AMDGPU_GLOBAL_LOAD_MONITOR, G_AMDGPU_FLAT_LOAD_MONITOR},
1767 addRulesForGOpcs({G_AMDGPU_WHOLE_WAVE_FUNC_SETUP})
1770 addRulesForGOpcs({G_AMDGPU_WHOLE_WAVE_FUNC_RETURN}).
Any({{}, {{}, {
Vcc}}});
1774 addRulesForIOpcs({returnaddress}).
Any({{
UniP0}, {{
SgprP0}, {}}});
1780 addRulesForIOpcs({amdgcn_s_setreg})
1783 addRulesForIOpcs({amdgcn_s_sendmsg, amdgcn_s_sendmsghalt})
1786 addRulesForIOpcs({amdgcn_s_sendmsg_rtn})
1790 addRulesForIOpcs({amdgcn_s_memrealtime, amdgcn_s_memtime},
Standard)
1793 addRulesForIOpcs({amdgcn_groupstaticsize, amdgcn_pops_exiting_wave_id,
1794 amdgcn_reloc_constant, amdgcn_s_get_waveid_in_workgroup},
1799 addRulesForIOpcs({amdgcn_asyncmark,
1804 amdgcn_s_barrier_leave,
1805 amdgcn_s_barrier_signal,
1806 amdgcn_s_barrier_wait,
1807 amdgcn_s_decperflevel,
1808 amdgcn_s_incperflevel,
1809 amdgcn_s_monitor_sleep,
1813 amdgcn_s_setprio_inc_wg,
1815 amdgcn_s_ttracedata_imm,
1816 amdgcn_s_wait_asynccnt,
1817 amdgcn_s_wait_bvhcnt,
1818 amdgcn_s_wait_dscnt,
1819 amdgcn_s_wait_event,
1820 amdgcn_s_wait_event_export_ready,
1821 amdgcn_s_wait_expcnt,
1822 amdgcn_s_wait_kmcnt,
1823 amdgcn_s_wait_loadcnt,
1824 amdgcn_s_wait_samplecnt,
1825 amdgcn_s_wait_storecnt,
1826 amdgcn_s_wait_tensorcnt,
1828 amdgcn_sched_barrier,
1829 amdgcn_sched_group_barrier,
1831 amdgcn_wait_asyncmark,
1832 amdgcn_wave_barrier})
1833 .
Any({{}, {{}, {}}});
1835 addRulesForIOpcs({amdgcn_init_exec_from_input})
1840 addRulesForIOpcs({amdgcn_s_sleep_var})
1843 addRulesForIOpcs({amdgcn_s_barrier_join, amdgcn_s_wakeup_barrier})
1846 addRulesForIOpcs({amdgcn_s_barrier_signal_var, amdgcn_s_barrier_init})
1849 addRulesForIOpcs({amdgcn_s_barrier_signal_isfirst})
1853 {amdgcn_s_get_named_barrier_state, amdgcn_s_get_barrier_state},
Standard)
1856 addRulesForIOpcs({amdgcn_flat_prefetch}).
Any({{}, {{}, {
IntrId,
VgprP0}}});
1858 addRulesForIOpcs({amdgcn_global_prefetch}).
Any({{}, {{}, {
IntrId,
VgprP1}}});
1860 addRulesForIOpcs({amdgcn_s_prefetch_data, amdgcn_s_prefetch_inst})
1863 addRulesForIOpcs({amdgcn_class})
1872 addRulesForIOpcs({amdgcn_end_cf})
1876 addRulesForIOpcs({amdgcn_if_break},
Standard)
1880 addRulesForIOpcs({amdgcn_exp})
1884 addRulesForIOpcs({amdgcn_exp_compr})
1887 addRulesForIOpcs({amdgcn_exp_row})
1893 addRulesForIOpcs({amdgcn_lds_direct_load},
StandardB)
1896 addRulesForIOpcs({amdgcn_lds_param_load},
Standard)
1899 addRulesForIOpcs({amdgcn_mbcnt_lo, amdgcn_mbcnt_hi},
Standard)
1902 addRulesForIOpcs({amdgcn_readfirstlane})
1908 addRulesForIOpcs({amdgcn_readlane},
StandardB)
1911 addRulesForIOpcs({amdgcn_s_quadmask, amdgcn_s_wqm},
StandardB)
1915 addRulesForIOpcs({amdgcn_writelane},
StandardB)
1920 addRulesForIOpcs({amdgcn_add_max_i32, amdgcn_add_max_u32, amdgcn_add_min_i32,
1921 amdgcn_add_min_u32},
1926 addRulesForIOpcs({amdgcn_pk_add_max_i16, amdgcn_pk_add_max_u16,
1927 amdgcn_pk_add_min_i16, amdgcn_pk_add_min_u16},
1932 addRulesForIOpcs({amdgcn_permlane16, amdgcn_permlanex16},
StandardB)
1937 addRulesForIOpcs({amdgcn_permlane_bcast, amdgcn_permlane_up,
1938 amdgcn_permlane_down, amdgcn_permlane_xor},
1944 addRulesForIOpcs({amdgcn_permlane_idx_gen},
Standard)
1947 addRulesForIOpcs({amdgcn_alignbyte, amdgcn_perm},
Standard)
1951 addRulesForIOpcs({amdgcn_mqsad_pk_u16_u8, amdgcn_qsad_pk_u16_u8},
Standard)
1955 addRulesForIOpcs({amdgcn_mqsad_u32_u8})
1960 addRulesForIOpcs({amdgcn_lerp},
Standard)
1965 {amdgcn_msad_u8, amdgcn_sad_hi_u8, amdgcn_sad_u16, amdgcn_sad_u8},
1971 {amdgcn_wave_reduce_add, amdgcn_wave_reduce_and, amdgcn_wave_reduce_fadd,
1972 amdgcn_wave_reduce_fmax, amdgcn_wave_reduce_fmin,
1973 amdgcn_wave_reduce_fsub, amdgcn_wave_reduce_max, amdgcn_wave_reduce_min,
1974 amdgcn_wave_reduce_or, amdgcn_wave_reduce_sub, amdgcn_wave_reduce_umax,
1975 amdgcn_wave_reduce_umin, amdgcn_wave_reduce_xor},
1982 addRulesForIOpcs({amdgcn_wave_shuffle},
Standard)
1986 addRulesForIOpcs({amdgcn_bitop3, amdgcn_fmad_ftz},
Standard)
1992 addRulesForIOpcs({amdgcn_udot4, amdgcn_sdot4, amdgcn_udot8, amdgcn_sdot8,
1993 amdgcn_dot4_f32_bf8_bf8, amdgcn_dot4_f32_bf8_fp8,
1994 amdgcn_dot4_f32_fp8_fp8, amdgcn_dot4_f32_fp8_bf8},
1999 addRulesForIOpcs({amdgcn_rsq, amdgcn_rsq_clamp})
2010 addRulesForIOpcs({amdgcn_mul_u24, amdgcn_mul_i24},
Standard)
2016 addRulesForIOpcs({amdgcn_ds_bpermute, amdgcn_ds_bpermute_fi_b32,
2017 amdgcn_ds_permute, amdgcn_fmul_legacy, amdgcn_mulhi_i24,
2023 addRulesForIOpcs({amdgcn_cvt_sr_bf8_f32, amdgcn_cvt_sr_fp8_f32,
2024 amdgcn_cvt_sr_fp8_f32_e5m3, amdgcn_cvt_pk_bf8_f32,
2025 amdgcn_cvt_pk_fp8_f32, amdgcn_cvt_pk_fp8_f32_e5m3,
2026 amdgcn_cvt_pk_u8_f32},
2031 addRulesForIOpcs({amdgcn_cvt_off_f32_i4, amdgcn_cvt_f32_bf8,
2032 amdgcn_cvt_f32_fp8, amdgcn_cvt_f32_fp8_e5m3},
2037 addRulesForIOpcs({amdgcn_cvt_pk_f32_bf8, amdgcn_cvt_pk_f32_fp8})
2041 addRulesForIOpcs({amdgcn_cvt_f16_bf8, amdgcn_cvt_f16_fp8},
Standard)
2045 addRulesForIOpcs({amdgcn_cvt_pk_f16_bf8, amdgcn_cvt_pk_f16_fp8},
Standard)
2049 addRulesForIOpcs({amdgcn_cvt_pk_bf8_f16, amdgcn_cvt_pk_fp8_f16},
Standard)
2053 addRulesForIOpcs({amdgcn_cvt_sr_bf8_f16, amdgcn_cvt_sr_fp8_f16},
Standard)
2057 addRulesForIOpcs({amdgcn_cvt_sr_pk_f16_f32, amdgcn_cvt_sr_pk_bf16_f32},
2063 {amdgcn_cvt_scalef32_sr_fp8_f16, amdgcn_cvt_scalef32_sr_bf8_f16,
2064 amdgcn_cvt_scalef32_sr_fp8_bf16, amdgcn_cvt_scalef32_sr_bf8_bf16})
2070 {amdgcn_cvt_scalef32_sr_fp8_f32, amdgcn_cvt_scalef32_sr_bf8_f32})
2075 addRulesForIOpcs({amdgcn_cubesc, amdgcn_cubetc, amdgcn_cubema, amdgcn_cubeid,
2081 addRulesForIOpcs({amdgcn_frexp_mant, amdgcn_fract},
Standard)
2089 addRulesForIOpcs({amdgcn_prng_b32})
2093 addRulesForIOpcs({amdgcn_sffbh},
Standard)
2097 addRulesForIOpcs({amdgcn_ubfe, amdgcn_sbfe},
Standard)
2103 addRulesForIOpcs({amdgcn_cvt_pk_i16, amdgcn_cvt_pk_u16, amdgcn_cvt_pknorm_i16,
2104 amdgcn_cvt_pknorm_u16},
2109 addRulesForIOpcs({amdgcn_cvt_pkrtz},
Standard)
2114 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk32_bf6_f16,
2115 amdgcn_cvt_scalef32_sr_pk32_fp6_f16,
2116 amdgcn_cvt_scalef32_sr_pk32_bf6_bf16,
2117 amdgcn_cvt_scalef32_sr_pk32_fp6_bf16},
2123 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk32_bf6_f32,
2124 amdgcn_cvt_scalef32_sr_pk32_fp6_f32},
2131 {amdgcn_cvt_scalef32_sr_pk_fp4_f16, amdgcn_cvt_scalef32_sr_pk_fp4_bf16},
2136 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk_fp4_f32},
Standard)
2141 {amdgcn_cvt_scalef32_2xpk16_fp6_f32, amdgcn_cvt_scalef32_2xpk16_bf6_f32})
2147 addRulesForIOpcs({amdgcn_cvt_scalef32_f16_fp8, amdgcn_cvt_scalef32_f16_bf8},
2152 addRulesForIOpcs({amdgcn_cvt_scalef32_f32_fp8, amdgcn_cvt_scalef32_f32_bf8},
2158 {amdgcn_cvt_scalef32_pk16_bf6_f16, amdgcn_cvt_scalef32_pk16_fp6_f16,
2159 amdgcn_cvt_scalef32_pk16_bf6_bf16, amdgcn_cvt_scalef32_pk16_fp6_bf16},
2165 {amdgcn_cvt_scalef32_pk16_bf6_f32, amdgcn_cvt_scalef32_pk16_fp6_f32},
2171 {amdgcn_cvt_scalef32_pk8_bf8_f16, amdgcn_cvt_scalef32_pk8_fp8_f16,
2172 amdgcn_cvt_scalef32_pk8_bf8_bf16, amdgcn_cvt_scalef32_pk8_fp8_bf16},
2178 {amdgcn_cvt_scalef32_pk8_bf8_f32, amdgcn_cvt_scalef32_pk8_fp8_f32},
2184 {amdgcn_cvt_scalef32_pk8_fp4_f16, amdgcn_cvt_scalef32_pk8_fp4_bf16},
2189 addRulesForIOpcs({amdgcn_cvt_scalef32_pk8_fp4_f32},
Standard)
2193 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk16_bf6_f16,
2194 amdgcn_cvt_scalef32_sr_pk16_fp6_f16,
2195 amdgcn_cvt_scalef32_sr_pk16_bf6_bf16,
2196 amdgcn_cvt_scalef32_sr_pk16_fp6_bf16},
2202 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk16_bf6_f32,
2203 amdgcn_cvt_scalef32_sr_pk16_fp6_f32},
2209 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk8_bf8_f16,
2210 amdgcn_cvt_scalef32_sr_pk8_fp8_f16,
2211 amdgcn_cvt_scalef32_sr_pk8_bf8_bf16,
2212 amdgcn_cvt_scalef32_sr_pk8_fp8_bf16},
2219 {amdgcn_cvt_scalef32_sr_pk8_bf8_f32, amdgcn_cvt_scalef32_sr_pk8_fp8_f32},
2226 {amdgcn_cvt_scalef32_sr_pk8_fp4_f16, amdgcn_cvt_scalef32_sr_pk8_fp4_bf16},
2231 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk8_fp4_f32},
Standard)
2236 {amdgcn_cvt_scale_pk16_f16_bf6, amdgcn_cvt_scale_pk16_f16_fp6,
2237 amdgcn_cvt_scale_pk16_bf16_bf6, amdgcn_cvt_scale_pk16_bf16_fp6},
2243 {amdgcn_cvt_scale_pk16_f32_bf6, amdgcn_cvt_scale_pk16_f32_fp6},
Standard)
2247 addRulesForIOpcs({amdgcn_cvt_scale_pk8_f16_bf8, amdgcn_cvt_scale_pk8_f16_fp8,
2248 amdgcn_cvt_scale_pk8_bf16_bf8,
2249 amdgcn_cvt_scale_pk8_bf16_fp8},
2255 {amdgcn_cvt_scale_pk8_f16_fp4, amdgcn_cvt_scale_pk8_bf16_fp4},
Standard)
2259 addRulesForIOpcs({amdgcn_cvt_scale_pk8_f32_bf8, amdgcn_cvt_scale_pk8_f32_fp8},
2264 addRulesForIOpcs({amdgcn_cvt_scale_pk8_f32_fp4},
Standard)
2269 {amdgcn_cvt_scalef32_pk32_bf6_f16, amdgcn_cvt_scalef32_pk32_fp6_f16,
2270 amdgcn_cvt_scalef32_pk32_bf6_bf16, amdgcn_cvt_scalef32_pk32_fp6_bf16},
2276 {amdgcn_cvt_scalef32_pk32_bf6_f32, amdgcn_cvt_scalef32_pk32_fp6_f32},
2282 {amdgcn_cvt_scalef32_pk_fp8_f32, amdgcn_cvt_scalef32_pk_bf8_f32},
2289 {amdgcn_cvt_scalef32_pk_f32_fp8, amdgcn_cvt_scalef32_pk_f32_bf8},
2295 {amdgcn_cvt_scalef32_pk_fp8_f16, amdgcn_cvt_scalef32_pk_bf8_f16,
2296 amdgcn_cvt_scalef32_pk_fp8_bf16, amdgcn_cvt_scalef32_pk_bf8_bf16},
2301 addRulesForIOpcs({amdgcn_cvt_scalef32_pk_f32_fp4},
Standard)
2305 addRulesForIOpcs({amdgcn_cvt_scalef32_pk_fp4_f32},
Standard)
2310 {amdgcn_cvt_scalef32_pk_f16_fp4, amdgcn_cvt_scalef32_pk_f16_fp8,
2311 amdgcn_cvt_scalef32_pk_f16_bf8, amdgcn_cvt_scalef32_pk_bf16_fp4,
2312 amdgcn_cvt_scalef32_pk_bf16_fp8, amdgcn_cvt_scalef32_pk_bf16_bf8},
2318 {amdgcn_cvt_scalef32_pk32_f32_fp6, amdgcn_cvt_scalef32_pk32_f32_bf6},
2324 {amdgcn_cvt_scalef32_pk32_f16_fp6, amdgcn_cvt_scalef32_pk32_f16_bf6,
2325 amdgcn_cvt_scalef32_pk32_bf16_fp6, amdgcn_cvt_scalef32_pk32_bf16_bf6},
2331 {amdgcn_cvt_scalef32_pk_fp4_f16, amdgcn_cvt_scalef32_pk_fp4_bf16},
2336 addRulesForIOpcs({amdgcn_global_load_tr_b64})
2342 addRulesForIOpcs({amdgcn_global_load_tr_b128})
2348 addRulesForIOpcs({amdgcn_global_load_tr4_b64})
2352 addRulesForIOpcs({amdgcn_global_load_tr6_b96})
2356 addRulesForIOpcs({amdgcn_ds_load_tr4_b64, amdgcn_ds_load_tr8_b64})
2359 addRulesForIOpcs({amdgcn_ds_load_tr6_b96})
2362 addRulesForIOpcs({amdgcn_ds_load_tr16_b128})
2365 addRulesForIOpcs({amdgcn_global_atomic_ordered_add_b64})
2369 {amdgcn_global_atomic_fmin_num, amdgcn_global_atomic_fmax_num},
Standard)
2372 addRulesForIOpcs({amdgcn_flat_atomic_fmin_num, amdgcn_flat_atomic_fmax_num},
2376 addRulesForIOpcs({amdgcn_raw_buffer_load_lds})
2379 addRulesForIOpcs({amdgcn_raw_buffer_load_async_lds})
2382 addRulesForIOpcs({amdgcn_struct_buffer_load_async_lds})
2387 addRulesForIOpcs({amdgcn_struct_buffer_load_lds})
2391 addRulesForIOpcs({amdgcn_raw_ptr_buffer_load_lds})
2394 addRulesForIOpcs({amdgcn_raw_ptr_buffer_load_async_lds})
2397 addRulesForIOpcs({amdgcn_struct_ptr_buffer_load_async_lds})
2401 addRulesForIOpcs({amdgcn_struct_ptr_buffer_load_lds})
2405 {amdgcn_global_load_lds, amdgcn_load_to_lds, amdgcn_load_async_to_lds})
2408 addRulesForIOpcs({amdgcn_global_load_async_to_lds_b8,
2409 amdgcn_global_load_async_to_lds_b32,
2410 amdgcn_global_load_async_to_lds_b64,
2411 amdgcn_global_load_async_to_lds_b128,
2412 amdgcn_global_store_async_from_lds_b8,
2413 amdgcn_global_store_async_from_lds_b32,
2414 amdgcn_global_store_async_from_lds_b64,
2415 amdgcn_global_store_async_from_lds_b128})
2418 addRulesForIOpcs({amdgcn_global_load_async_lds})
2421 addRulesForIOpcs({amdgcn_tensor_load_to_lds, amdgcn_tensor_store_from_lds})
2428 addRulesForIOpcs({amdgcn_cluster_load_b32})
2434 addRulesForIOpcs({amdgcn_cluster_load_b64})
2440 addRulesForIOpcs({amdgcn_cluster_load_b128})
2447 addRulesForIOpcs({amdgcn_cluster_load_async_to_lds_b8,
2448 amdgcn_cluster_load_async_to_lds_b32,
2449 amdgcn_cluster_load_async_to_lds_b64,
2450 amdgcn_cluster_load_async_to_lds_b128})
2453 addRulesForIOpcs({amdgcn_perm_pk16_b4_u4},
StandardB)
2457 addRulesForIOpcs({amdgcn_perm_pk16_b6_u4},
StandardB)
2461 addRulesForIOpcs({amdgcn_perm_pk16_b8_u4},
StandardB)
2465 addRulesForIOpcs({amdgcn_wwm, amdgcn_strict_wwm, amdgcn_wqm, amdgcn_softwqm,
2483 addRulesForIOpcs({amdgcn_kill, amdgcn_wqm_demote})
2486 addRulesForIOpcs({amdgcn_set_inactive},
StandardB)
2489 addRulesForIOpcs({amdgcn_set_inactive_chain_arg},
Standard)
2492 addRulesForIOpcs({amdgcn_cvt_sr_bf16_f32, amdgcn_cvt_sr_f16_f32},
Standard)
2495 addRulesForIOpcs({amdgcn_ballot},
Standard)
2499 addRulesForIOpcs({amdgcn_inverse_ballot})
2503 addRulesForIOpcs({amdgcn_live_mask, amdgcn_ps_live})
2506 addRulesForIOpcs({amdgcn_mov_dpp, amdgcn_mov_dpp8},
StandardB)
2510 addRulesForIOpcs({amdgcn_update_dpp},
StandardB)
2514 addRulesForIOpcs({amdgcn_sin, amdgcn_cos, amdgcn_tanh},
Standard)
2520 addRulesForIOpcs({amdgcn_trig_preop},
Standard)
2524 addRulesForIOpcs({amdgcn_exp2})
2533 addRulesForIOpcs({amdgcn_rcp, amdgcn_sqrt})
2544 addRulesForIOpcs({amdgcn_log})
2553 addRulesForIOpcs({amdgcn_ds_atomic_async_barrier_arrive_b64})
2556 addRulesForIOpcs({amdgcn_ds_atomic_barrier_arrive_rtn_b64},
Standard)
2559 addRulesForIOpcs({amdgcn_ds_add_gs_reg_rtn, amdgcn_ds_sub_gs_reg_rtn},
2564 addRulesForIOpcs({amdgcn_ds_append, amdgcn_ds_consume},
Standard)
2569 {amdgcn_ds_bvh_stack_rtn, amdgcn_ds_bvh_stack_push4_pop1_rtn},
Standard)
2572 addRulesForIOpcs({amdgcn_ds_bvh_stack_push8_pop1_rtn},
Standard)
2575 addRulesForIOpcs({amdgcn_ds_bvh_stack_push8_pop2_rtn},
Standard)
2578 addRulesForIOpcs({amdgcn_ds_gws_sema_p, amdgcn_ds_gws_sema_v,
2579 amdgcn_ds_gws_sema_release_all})
2583 {amdgcn_ds_gws_barrier, amdgcn_ds_gws_init, amdgcn_ds_gws_sema_br})
2586 addRulesForIOpcs({amdgcn_ds_ordered_add, amdgcn_ds_ordered_swap},
Standard)
2589 addRulesForIOpcs({amdgcn_ds_swizzle},
Standard)
2593 addRulesForIOpcs({amdgcn_permlane16_var, amdgcn_permlanex16_var},
Standard)
2596 addRulesForIOpcs({amdgcn_permlane16_swap, amdgcn_permlane32_swap},
Standard)
2599 addRulesForIOpcs({amdgcn_permlane64},
StandardB)
2602 addRulesForIOpcs({amdgcn_ds_read_tr4_b64, amdgcn_ds_read_tr8_b64})
2605 addRulesForIOpcs({amdgcn_ds_read_tr6_b96})
2608 addRulesForIOpcs({amdgcn_ds_read_tr16_b64})
2611 addRulesForIOpcs({amdgcn_interp_p1},
Standard)
2614 addRulesForIOpcs({amdgcn_interp_p1_f16},
Standard)
2617 addRulesForIOpcs({amdgcn_interp_p2},
Standard)
2620 addRulesForIOpcs({amdgcn_interp_p2_f16},
Standard)
2624 addRulesForIOpcs({amdgcn_interp_mov},
Standard)
2627 addRulesForIOpcs({amdgcn_interp_inreg_p10, amdgcn_interp_inreg_p2,
2628 amdgcn_interp_inreg_p10_f16, amdgcn_interp_p10_rtz_f16},
2633 addRulesForIOpcs({amdgcn_interp_inreg_p2_f16, amdgcn_interp_p2_rtz_f16},
2638 addRulesForIOpcs({amdgcn_frexp_exp})
2646 addRulesForIOpcs({amdgcn_div_fmas},
Standard)
2652 addRulesForIOpcs({amdgcn_div_fixup},
Standard)
2660 addRulesForIOpcs({amdgcn_div_scale},
Standard)
2667 {amdgcn_fdot2, amdgcn_fdot2_f32_bf16, amdgcn_sdot2, amdgcn_udot2},
2672 addRulesForIOpcs({amdgcn_fdot2_f16_f16, amdgcn_fdot2_bf16_bf16},
Standard)
2676 addRulesForIOpcs({amdgcn_sudot4, amdgcn_sudot8},
Standard)
2680 addRulesForIOpcs({amdgcn_s_alloc_vgpr})
2683 addRulesForIOpcs({amdgcn_sat_pk4_i4_i8, amdgcn_sat_pk4_u4_u8},
Standard)
2687 bool HasGFX90AInsts = ST->hasGFX90AInsts();
2690 addRulesForIOpcs({amdgcn_mfma_f32_32x32x1f32, amdgcn_mfma_f32_16x16x1f32,
2691 amdgcn_mfma_f32_4x4x1f32, amdgcn_mfma_f32_32x32x2f32,
2692 amdgcn_mfma_f32_16x16x4f32, amdgcn_mfma_f32_32x32x4f16,
2693 amdgcn_mfma_f32_16x16x4f16, amdgcn_mfma_f32_4x4x4f16,
2694 amdgcn_mfma_f32_32x32x8f16, amdgcn_mfma_f32_16x16x16f16,
2695 amdgcn_mfma_i32_32x32x4i8, amdgcn_mfma_i32_16x16x4i8,
2696 amdgcn_mfma_i32_4x4x4i8, amdgcn_mfma_i32_32x32x8i8,
2697 amdgcn_mfma_i32_16x16x16i8, amdgcn_mfma_f32_32x32x2bf16,
2698 amdgcn_mfma_f32_16x16x2bf16, amdgcn_mfma_f32_4x4x2bf16,
2699 amdgcn_mfma_f32_32x32x4bf16, amdgcn_mfma_f32_16x16x8bf16})
2710 amdgcn_mfma_f32_32x32x4bf16_1k,
2711 amdgcn_mfma_f32_16x16x4bf16_1k,
2712 amdgcn_mfma_f32_4x4x4bf16_1k,
2713 amdgcn_mfma_f32_32x32x8bf16_1k,
2714 amdgcn_mfma_f32_16x16x16bf16_1k,
2715 amdgcn_mfma_f64_16x16x4f64,
2716 amdgcn_mfma_f64_4x4x4f64,
2717 amdgcn_mfma_i32_16x16x32_i8,
2718 amdgcn_mfma_i32_32x32x16_i8,
2719 amdgcn_mfma_f32_16x16x8_xf32,
2720 amdgcn_mfma_f32_32x32x4_xf32,
2721 amdgcn_mfma_f32_16x16x32_bf8_bf8,
2722 amdgcn_mfma_f32_16x16x32_bf8_fp8,
2723 amdgcn_mfma_f32_16x16x32_fp8_bf8,
2724 amdgcn_mfma_f32_16x16x32_fp8_fp8,
2725 amdgcn_mfma_f32_32x32x16_bf8_bf8,
2726 amdgcn_mfma_f32_32x32x16_bf8_fp8,
2727 amdgcn_mfma_f32_32x32x16_fp8_bf8,
2728 amdgcn_mfma_f32_32x32x16_fp8_fp8,
2730 amdgcn_mfma_f32_16x16x32_f16,
2731 amdgcn_mfma_f32_32x32x16_f16,
2732 amdgcn_mfma_i32_16x16x64_i8,
2733 amdgcn_mfma_i32_32x32x32_i8,
2734 amdgcn_mfma_f32_16x16x32_bf16,
2735 amdgcn_mfma_f32_32x32x16_bf16,
2743 amdgcn_smfmac_f32_16x16x32_f16, amdgcn_smfmac_f32_32x32x16_f16,
2744 amdgcn_smfmac_f32_16x16x32_bf16, amdgcn_smfmac_f32_32x32x16_bf16,
2745 amdgcn_smfmac_i32_16x16x64_i8, amdgcn_smfmac_i32_32x32x32_i8,
2746 amdgcn_smfmac_f32_16x16x64_bf8_bf8, amdgcn_smfmac_f32_16x16x64_bf8_fp8,
2747 amdgcn_smfmac_f32_16x16x64_fp8_bf8, amdgcn_smfmac_f32_16x16x64_fp8_fp8,
2748 amdgcn_smfmac_f32_32x32x32_bf8_bf8, amdgcn_smfmac_f32_32x32x32_bf8_fp8,
2749 amdgcn_smfmac_f32_32x32x32_fp8_bf8, amdgcn_smfmac_f32_32x32x32_fp8_fp8,
2751 amdgcn_smfmac_f32_16x16x64_f16, amdgcn_smfmac_f32_32x32x32_f16,
2752 amdgcn_smfmac_f32_16x16x64_bf16, amdgcn_smfmac_f32_32x32x32_bf16,
2753 amdgcn_smfmac_i32_16x16x128_i8, amdgcn_smfmac_i32_32x32x64_i8,
2754 amdgcn_smfmac_f32_16x16x128_bf8_bf8, amdgcn_smfmac_f32_16x16x128_bf8_fp8,
2755 amdgcn_smfmac_f32_16x16x128_fp8_bf8, amdgcn_smfmac_f32_16x16x128_fp8_fp8,
2756 amdgcn_smfmac_f32_32x32x64_bf8_bf8, amdgcn_smfmac_f32_32x32x64_bf8_fp8,
2757 amdgcn_smfmac_f32_32x32x64_fp8_bf8, amdgcn_smfmac_f32_32x32x64_fp8_fp8})
2762 addRulesForIOpcs({amdgcn_mfma_scale_f32_32x32x64_f8f6f4,
2763 amdgcn_mfma_scale_f32_16x16x128_f8f6f4})
2772 amdgcn_wmma_f32_16x16x16_f16, amdgcn_wmma_f32_16x16x16_bf16,
2773 amdgcn_wmma_f16_16x16x16_f16, amdgcn_wmma_bf16_16x16x16_bf16,
2774 amdgcn_wmma_f16_16x16x16_f16_tied, amdgcn_wmma_bf16_16x16x16_bf16_tied,
2775 amdgcn_wmma_i32_16x16x16_iu8, amdgcn_wmma_i32_16x16x16_iu4,
2777 amdgcn_wmma_f32_16x16x16_fp8_fp8, amdgcn_wmma_f32_16x16x16_fp8_bf8,
2778 amdgcn_wmma_f32_16x16x16_bf8_fp8, amdgcn_wmma_f32_16x16x16_bf8_bf8,
2779 amdgcn_wmma_i32_16x16x32_iu4,
2781 amdgcn_wmma_f32_16x16x4_f32, amdgcn_wmma_f32_16x16x32_bf16,
2782 amdgcn_wmma_f32_16x16x32_f16, amdgcn_wmma_f16_16x16x32_f16,
2783 amdgcn_wmma_bf16_16x16x32_bf16, amdgcn_wmma_bf16f32_16x16x32_bf16,
2784 amdgcn_wmma_f32_16x16x64_fp8_fp8, amdgcn_wmma_f32_16x16x64_fp8_bf8,
2785 amdgcn_wmma_f32_16x16x64_bf8_fp8, amdgcn_wmma_f32_16x16x64_bf8_bf8,
2786 amdgcn_wmma_f16_16x16x64_fp8_fp8, amdgcn_wmma_f16_16x16x64_fp8_bf8,
2787 amdgcn_wmma_f16_16x16x64_bf8_fp8, amdgcn_wmma_f16_16x16x64_bf8_bf8,
2788 amdgcn_wmma_f16_16x16x128_fp8_fp8, amdgcn_wmma_f16_16x16x128_fp8_bf8,
2789 amdgcn_wmma_f16_16x16x128_bf8_fp8, amdgcn_wmma_f16_16x16x128_bf8_bf8,
2790 amdgcn_wmma_f32_16x16x128_fp8_fp8, amdgcn_wmma_f32_16x16x128_fp8_bf8,
2791 amdgcn_wmma_f32_16x16x128_bf8_fp8, amdgcn_wmma_f32_16x16x128_bf8_bf8,
2792 amdgcn_wmma_i32_16x16x64_iu8, amdgcn_wmma_f32_16x16x128_f8f6f4,
2793 amdgcn_wmma_scale_f32_16x16x128_f8f6f4,
2794 amdgcn_wmma_scale16_f32_16x16x128_f8f6f4, amdgcn_wmma_f32_32x16x128_f4,
2795 amdgcn_wmma_scale_f32_32x16x128_f4, amdgcn_wmma_scale16_f32_32x16x128_f4,
2797 amdgcn_wmma_f64_16x16x4_f64,
2799 amdgcn_swmmac_f32_16x16x32_f16, amdgcn_swmmac_f32_16x16x32_bf16,
2800 amdgcn_swmmac_f16_16x16x32_f16, amdgcn_swmmac_bf16_16x16x32_bf16,
2801 amdgcn_swmmac_i32_16x16x32_iu8, amdgcn_swmmac_i32_16x16x32_iu4,
2802 amdgcn_swmmac_i32_16x16x64_iu4, amdgcn_swmmac_f32_16x16x32_fp8_fp8,
2803 amdgcn_swmmac_f32_16x16x32_fp8_bf8, amdgcn_swmmac_f32_16x16x32_bf8_fp8,
2804 amdgcn_swmmac_f32_16x16x32_bf8_bf8,
2806 amdgcn_swmmac_f32_16x16x64_f16, amdgcn_swmmac_f32_16x16x64_bf16,
2807 amdgcn_swmmac_f16_16x16x64_f16, amdgcn_swmmac_bf16_16x16x64_bf16,
2808 amdgcn_swmmac_bf16f32_16x16x64_bf16, amdgcn_swmmac_f32_16x16x128_fp8_fp8,
2809 amdgcn_swmmac_f32_16x16x128_fp8_bf8, amdgcn_swmmac_f32_16x16x128_bf8_fp8,
2810 amdgcn_swmmac_f32_16x16x128_bf8_bf8, amdgcn_swmmac_f16_16x16x128_fp8_fp8,
2811 amdgcn_swmmac_f16_16x16x128_fp8_bf8, amdgcn_swmmac_f16_16x16x128_bf8_fp8,
2812 amdgcn_swmmac_f16_16x16x128_bf8_bf8, amdgcn_swmmac_i32_16x16x128_iu8})