586 : ST(&_ST), MRI(&_MRI) {
588 addRulesForGOpcs({G_ADD, G_SUB},
Standard)
598 addRulesForGOpcs({G_UADDO, G_USUBO},
Standard)
602 addRulesForGOpcs({G_UADDE, G_USUBE, G_SADDE, G_SSUBE},
Standard)
606 addRulesForGOpcs({G_UADDSAT, G_SADDSAT, G_USUBSAT, G_SSUBSAT},
Standard)
614 bool HasVecMulU64 = ST->hasVMulU64Inst();
626 bool hasMulHi = ST->hasScalarMulHiInsts();
627 addRulesForGOpcs({G_UMULH, G_SMULH},
Standard)
632 addRulesForGOpcs({G_AMDGPU_MAD_U64_U32},
Standard)
636 bool HasScalarSMulU64 = ST->hasScalarSMulU64();
637 addRulesForGOpcs({G_AMDGPU_S_MUL_U64_U32, G_AMDGPU_S_MUL_I64_I32},
Standard)
641 addRulesForGOpcs({G_XOR, G_OR, G_AND},
StandardB)
661 addRulesForGOpcs({G_LSHR},
Standard)
671 addRulesForGOpcs({G_ASHR},
Standard)
681 addRulesForGOpcs({G_FSHR},
Standard)
685 addRulesForGOpcs({G_BSWAP},
Standard)
693 addRulesForGOpcs({G_AMDGPU_CVT_F32_UBYTE0, G_AMDGPU_CVT_F32_UBYTE1,
694 G_AMDGPU_CVT_F32_UBYTE2, G_AMDGPU_CVT_F32_UBYTE3,
702 addRulesForGOpcs({G_UBFX, G_SBFX},
Standard)
708 addRulesForGOpcs({G_SMIN, G_SMAX},
Standard)
718 addRulesForGOpcs({G_UMIN, G_UMAX},
Standard)
728 addRulesForGOpcs({G_IMPLICIT_DEF})
733 addRulesForGOpcs({G_CONSTANT},
Standard)
741 addRulesForGOpcs({G_FCONSTANT},
Standard)
746 addRulesForGOpcs({G_FREEZE})
753 addRulesForGOpcs({G_BITCAST})
757 addRulesForGOpcs({G_UNMERGE_VALUES})
762 addRulesForGOpcs({G_BUILD_VECTOR, G_MERGE_VALUES})
768 addRulesForGOpcs({G_CONCAT_VECTORS})
772 addRulesForGOpcs({G_PHI})
778 addRulesForGOpcs({G_EXTRACT_VECTOR_ELT})
789 addRulesForGOpcs({G_INSERT_VECTOR_ELT})
805 addRulesForGOpcs({G_AMDGPU_BVH_INTERSECT_RAY, G_AMDGPU_BVH_DUAL_INTERSECT_RAY,
806 G_AMDGPU_BVH8_INTERSECT_RAY})
813 addRulesForGOpcs({G_AMDGPU_INTRIN_IMAGE_LOAD, G_AMDGPU_INTRIN_IMAGE_LOAD_D16,
814 G_AMDGPU_INTRIN_IMAGE_LOAD_NORET,
815 G_AMDGPU_INTRIN_IMAGE_STORE,
816 G_AMDGPU_INTRIN_IMAGE_STORE_D16})
831 bool HasScalarCompareEq64 = ST->hasScalarCompareEq64();
833 addRulesForGOpcs({G_ICMP})
852 addRulesForGOpcs({G_BRCOND})
856 addRulesForGOpcs({G_BR}).
Any({{
_}, {{}, {
None}}});
866 addRulesForGOpcs({G_ANYEXT})
878 bool Has16bitCmp = ST->has16BitInsts();
885 addRulesForGOpcs({G_TRUNC})
901 addRulesForGOpcs({G_ZEXT})
916 addRulesForGOpcs({G_SEXT})
931 addRulesForGOpcs({G_SEXT_INREG})
937 addRulesForGOpcs({G_ASSERT_ZEXT, G_ASSERT_SEXT},
Standard)
943 addRulesForGOpcs({G_ASSERT_ALIGN},
Standard)
955 addRulesForGOpcs({G_ATOMICRMW_ADD, G_ATOMICRMW_SUB, G_ATOMICRMW_XCHG,
956 G_ATOMICRMW_AND, G_ATOMICRMW_OR, G_ATOMICRMW_XOR,
957 G_ATOMICRMW_MIN, G_ATOMICRMW_MAX, G_ATOMICRMW_UMIN,
958 G_ATOMICRMW_UMAX, G_ATOMICRMW_UINC_WRAP,
959 G_ATOMICRMW_UDEC_WRAP, G_ATOMICRMW_FMIN, G_ATOMICRMW_FMAX})
967 addRulesForGOpcs({G_ATOMICRMW_USUB_SAT, G_ATOMICRMW_USUB_COND})
972 bool HasAtomicFlatPkAdd16Insts = ST->hasAtomicFlatPkAdd16Insts();
973 bool HasAtomicBufferGlobalPkAddF16Insts =
974 ST->hasAtomicBufferGlobalPkAddF16NoRtnInsts() ||
975 ST->hasAtomicBufferGlobalPkAddF16Insts();
976 bool HasAtomicDsPkAdd16Insts = ST->hasAtomicDsPkAdd16Insts();
977 addRulesForGOpcs({G_ATOMICRMW_FADD})
985 HasAtomicFlatPkAdd16Insts)
987 HasAtomicBufferGlobalPkAddF16Insts)
989 HasAtomicDsPkAdd16Insts);
991 addRulesForGOpcs({G_ATOMIC_CMPXCHG})
997 addRulesForGOpcs({G_AMDGPU_ATOMIC_CMPXCHG})
1003 addRulesForGOpcs({G_AMDGPU_BUFFER_ATOMIC_CMPSWAP},
Standard)
1009 addRulesForGOpcs({G_AMDGPU_BUFFER_ATOMIC_ADD, G_AMDGPU_BUFFER_ATOMIC_AND,
1010 G_AMDGPU_BUFFER_ATOMIC_DEC, G_AMDGPU_BUFFER_ATOMIC_FMAX,
1011 G_AMDGPU_BUFFER_ATOMIC_FMIN, G_AMDGPU_BUFFER_ATOMIC_INC,
1012 G_AMDGPU_BUFFER_ATOMIC_OR, G_AMDGPU_BUFFER_ATOMIC_SMAX,
1013 G_AMDGPU_BUFFER_ATOMIC_SMIN, G_AMDGPU_BUFFER_ATOMIC_SUB,
1014 G_AMDGPU_BUFFER_ATOMIC_SWAP, G_AMDGPU_BUFFER_ATOMIC_UMAX,
1015 G_AMDGPU_BUFFER_ATOMIC_UMIN, G_AMDGPU_BUFFER_ATOMIC_XOR},
1020 bool hasSMRDx3 = ST->hasScalarDwordx3Loads();
1021 bool hasSMRDSmall = ST->hasScalarSubwordLoads();
1022 bool usesTrue16 = ST->useRealTrue16Insts();
1025 return (*
MI.memoperands_begin())->getAlign() >=
Align(16);
1029 return (*
MI.memoperands_begin())->getAlign() >=
Align(4);
1033 return (*
MI.memoperands_begin())->isAtomic();
1049 return (*
MI.memoperands_begin())->isVolatile();
1053 return (*
MI.memoperands_begin())->isInvariant();
1068 return MemSize == 16 || MemSize == 8;
1076 auto isUL = !isAtomicMMO && isUniMMO && (isConst || !isVolatileMMO) &&
1077 (isConst || isInvMMO || isNoClobberMMO);
1081 addRulesForGOpcs({G_LOAD})
1188 addRulesForGOpcs({G_ZEXTLOAD, G_SEXTLOAD})
1213 addRulesForGOpcs({G_STORE})
1249 addRulesForGOpcs({G_AMDGPU_BUFFER_LOAD, G_AMDGPU_BUFFER_LOAD_FORMAT,
1250 G_AMDGPU_TBUFFER_LOAD_FORMAT},
1261 addRulesForGOpcs({G_AMDGPU_BUFFER_LOAD_USHORT, G_AMDGPU_BUFFER_LOAD_UBYTE,
1262 G_AMDGPU_BUFFER_LOAD_SSHORT, G_AMDGPU_BUFFER_LOAD_SBYTE},
1268 {G_AMDGPU_BUFFER_LOAD_UBYTE_TFE, G_AMDGPU_BUFFER_LOAD_USHORT_TFE},
1273 addRulesForGOpcs({G_AMDGPU_BUFFER_LOAD_TFE, G_AMDGPU_BUFFER_LOAD_FORMAT_TFE},
1286 {G_AMDGPU_BUFFER_LOAD_FORMAT_D16, G_AMDGPU_TBUFFER_LOAD_FORMAT_D16},
1295 addRulesForGOpcs({G_AMDGPU_S_BUFFER_LOAD})
1345 addRulesForGOpcs({G_AMDGPU_S_BUFFER_LOAD_SBYTE, G_AMDGPU_S_BUFFER_LOAD_UBYTE,
1346 G_AMDGPU_S_BUFFER_LOAD_SSHORT,
1347 G_AMDGPU_S_BUFFER_LOAD_USHORT})
1356 addRulesForGOpcs({G_AMDGPU_BUFFER_STORE, G_AMDGPU_BUFFER_STORE_BYTE,
1357 G_AMDGPU_BUFFER_STORE_SHORT, G_AMDGPU_BUFFER_STORE_FORMAT,
1358 G_AMDGPU_BUFFER_STORE_FORMAT_D16,
1359 G_AMDGPU_TBUFFER_STORE_FORMAT,
1360 G_AMDGPU_TBUFFER_STORE_FORMAT_D16})
1372 addRulesForGOpcs({G_AMDGPU_BUFFER_ATOMIC_FADD})
1381 addRulesForGOpcs({G_PTR_ADD})
1387 addRulesForGOpcs({G_INTTOPTR})
1395 addRulesForGOpcs({G_PTRTOINT})
1405 addRulesForGOpcs({G_PTRMASK})
1411 addRulesForGOpcs({G_DYN_STACKALLOC})
1415 addRulesForGOpcs({G_ABS},
Standard)
1423 addRulesForGOpcs({G_BITREVERSE},
Standard)
1429 addRulesForGOpcs({G_AMDGPU_FFBH_U32, G_AMDGPU_FFBL_B32, G_CTLZ_ZERO_POISON,
1430 G_CTTZ_ZERO_POISON})
1436 addRulesForGOpcs({G_CTPOP})
1442 addRulesForGOpcs({G_FENCE}).
Any({{{}}, {{}, {}}});
1444 addRulesForGOpcs({G_READSTEADYCOUNTER, G_READCYCLECOUNTER},
Standard)
1449 addRulesForGOpcs({G_GLOBAL_VALUE})
1456 addRulesForGOpcs({G_AMDGPU_WAVE_ADDRESS}).
Any({{
UniP5}, {{
SgprP5}, {}}});
1460 addRulesForGOpcs({G_SI_CALL})
1466 bool hasSALUFloat = ST->hasSALUFloatInsts();
1468 addRulesForGOpcs({G_FADD, G_FMUL, G_STRICT_FADD, G_STRICT_FMUL},
Standard)
1486 addRulesForGOpcs({G_FSUB, G_STRICT_FSUB},
Standard)
1494 addRulesForGOpcs({G_FMAD},
Standard)
1500 addRulesForGOpcs({G_FLDEXP, G_STRICT_FLDEXP},
Standard)
1508 addRulesForGOpcs({G_FMA, G_STRICT_FMA},
Standard)
1528 addRulesForGOpcs({G_AMDGPU_FMED3},
Standard)
1537 addRulesForGOpcs({G_AMDGPU_SMED3},
Standard)
1545 addRulesForGOpcs({G_FNEG, G_FABS},
Standard)
1560 addRulesForGOpcs({G_FCANONICALIZE},
Standard)
1574 bool hasPST = ST->hasPseudoScalarTrans();
1575 addRulesForGOpcs({G_FSQRT},
Standard)
1580 addRulesForGOpcs({G_FPTOUI, G_FPTOSI, G_FPTOUI_SAT, G_FPTOSI_SAT})
1592 addRulesForGOpcs({G_UITOFP, G_SITOFP})
1604 addRulesForGOpcs({G_AMDGPU_S_BUFFER_PREFETCH})
1609 return MI.getOperand(3).getImm() != 0;
1612 bool HasSMemPF = ST->hasSafeSmemPrefetch();
1613 bool HasVMemPF = ST->hasVmemPrefInsts();
1614 addRulesForGOpcs({G_PREFETCH})
1620 !HasSMemPF && !HasVMemPF)
1632 addRulesForGOpcs({G_FPEXT})
1639 addRulesForGOpcs({G_AMDGPU_CVT_PK_I16_I32},
Standard)
1643 addRulesForGOpcs({G_AMDGPU_FMIN_LEGACY, G_AMDGPU_FMAX_LEGACY},
Standard)
1647 bool hasSALUMinimumMaximumInsts = ST->hasSALUMinimumMaximumInsts();
1649 addRulesForGOpcs({G_FMINIMUM, G_FMAXIMUM},
Standard)
1661 addRulesForGOpcs({G_FMINNUM_IEEE, G_FMAXNUM_IEEE, G_FMINNUM, G_FMAXNUM,
1662 G_FMINIMUMNUM, G_FMAXIMUMNUM},
1675 addRulesForGOpcs({G_FPTRUNC})
1684 addRulesForGOpcs({G_INTRINSIC_FPTRUNC_ROUND})
1693 addRulesForGOpcs({G_IS_FPCLASS})
1701 addRulesForGOpcs({G_FCMP},
Standard)
1715 addRulesForGOpcs({G_INTRINSIC_ROUNDEVEN, G_FEXP2, G_FLOG2},
Standard)
1723 addRulesForGOpcs({G_INTRINSIC_TRUNC, G_FFLOOR, G_FCEIL},
Standard)
1733 addRulesForGOpcs({G_AMDGPU_GLOBAL_LOAD_MONITOR, G_AMDGPU_FLAT_LOAD_MONITOR},
1742 addRulesForGOpcs({G_AMDGPU_WHOLE_WAVE_FUNC_SETUP})
1745 addRulesForGOpcs({G_AMDGPU_WHOLE_WAVE_FUNC_RETURN}).
Any({{}, {{}, {
Vcc}}});
1749 addRulesForIOpcs({returnaddress}).
Any({{
UniP0}, {{
SgprP0}, {}}});
1753 addRulesForIOpcs({amdgcn_icmp})
1762 addRulesForIOpcs({amdgcn_fcmp})
1775 addRulesForIOpcs({amdgcn_s_setreg})
1778 addRulesForIOpcs({amdgcn_s_sendmsg, amdgcn_s_sendmsghalt})
1781 addRulesForIOpcs({amdgcn_s_sendmsg_rtn})
1785 addRulesForIOpcs({amdgcn_s_memrealtime, amdgcn_s_memtime},
Standard)
1788 addRulesForIOpcs({amdgcn_groupstaticsize, amdgcn_pops_exiting_wave_id,
1789 amdgcn_reloc_constant, amdgcn_s_get_waveid_in_workgroup},
1794 addRulesForIOpcs({amdgcn_asyncmark,
1799 amdgcn_s_barrier_leave,
1800 amdgcn_s_barrier_signal,
1801 amdgcn_s_barrier_wait,
1802 amdgcn_s_monitor_sleep,
1806 amdgcn_s_setprio_inc_wg,
1808 amdgcn_s_ttracedata_imm,
1809 amdgcn_s_wait_asynccnt,
1810 amdgcn_s_wait_bvhcnt,
1811 amdgcn_s_wait_dscnt,
1812 amdgcn_s_wait_event,
1813 amdgcn_s_wait_event_export_ready,
1814 amdgcn_s_wait_expcnt,
1815 amdgcn_s_wait_kmcnt,
1816 amdgcn_s_wait_loadcnt,
1817 amdgcn_s_wait_samplecnt,
1818 amdgcn_s_wait_storecnt,
1819 amdgcn_s_wait_tensorcnt,
1821 amdgcn_sched_barrier,
1822 amdgcn_sched_group_barrier,
1824 amdgcn_wait_asyncmark,
1825 amdgcn_wave_barrier})
1826 .
Any({{}, {{}, {}}});
1828 addRulesForIOpcs({amdgcn_init_exec_from_input})
1833 addRulesForIOpcs({amdgcn_s_sleep_var})
1836 addRulesForIOpcs({amdgcn_s_barrier_join, amdgcn_s_wakeup_barrier})
1839 addRulesForIOpcs({amdgcn_s_barrier_signal_var, amdgcn_s_barrier_init})
1842 addRulesForIOpcs({amdgcn_s_barrier_signal_isfirst})
1846 {amdgcn_s_get_named_barrier_state, amdgcn_s_get_barrier_state},
Standard)
1849 addRulesForIOpcs({amdgcn_flat_prefetch}).
Any({{}, {{}, {
IntrId,
VgprP0}}});
1851 addRulesForIOpcs({amdgcn_global_prefetch}).
Any({{}, {{}, {
IntrId,
VgprP1}}});
1853 addRulesForIOpcs({amdgcn_s_prefetch_data, amdgcn_s_prefetch_inst})
1856 addRulesForIOpcs({amdgcn_class})
1865 addRulesForIOpcs({amdgcn_end_cf})
1869 addRulesForIOpcs({amdgcn_if_break},
Standard)
1873 addRulesForIOpcs({amdgcn_exp})
1877 addRulesForIOpcs({amdgcn_exp_compr})
1880 addRulesForIOpcs({amdgcn_exp_row})
1886 addRulesForIOpcs({amdgcn_lds_direct_load},
StandardB)
1889 addRulesForIOpcs({amdgcn_lds_param_load},
Standard)
1892 addRulesForIOpcs({amdgcn_mbcnt_lo, amdgcn_mbcnt_hi},
Standard)
1895 addRulesForIOpcs({amdgcn_readfirstlane})
1901 addRulesForIOpcs({amdgcn_readlane},
StandardB)
1904 addRulesForIOpcs({amdgcn_s_quadmask, amdgcn_s_wqm},
StandardB)
1908 addRulesForIOpcs({amdgcn_writelane},
StandardB)
1913 addRulesForIOpcs({amdgcn_add_max_i32, amdgcn_add_max_u32, amdgcn_add_min_i32,
1914 amdgcn_add_min_u32},
1919 addRulesForIOpcs({amdgcn_pk_add_max_i16, amdgcn_pk_add_max_u16,
1920 amdgcn_pk_add_min_i16, amdgcn_pk_add_min_u16},
1925 addRulesForIOpcs({amdgcn_permlane16, amdgcn_permlanex16},
Standard)
1930 addRulesForIOpcs({amdgcn_permlane_bcast, amdgcn_permlane_up,
1931 amdgcn_permlane_down, amdgcn_permlane_xor},
1937 addRulesForIOpcs({amdgcn_permlane_idx_gen},
Standard)
1940 addRulesForIOpcs({amdgcn_perm},
Standard)
1945 {amdgcn_wave_reduce_add, amdgcn_wave_reduce_and, amdgcn_wave_reduce_fadd,
1946 amdgcn_wave_reduce_fmax, amdgcn_wave_reduce_fmin,
1947 amdgcn_wave_reduce_fsub, amdgcn_wave_reduce_max, amdgcn_wave_reduce_min,
1948 amdgcn_wave_reduce_or, amdgcn_wave_reduce_sub, amdgcn_wave_reduce_umax,
1949 amdgcn_wave_reduce_umin, amdgcn_wave_reduce_xor},
1956 addRulesForIOpcs({amdgcn_wave_shuffle},
Standard)
1960 addRulesForIOpcs({amdgcn_bitop3, amdgcn_fmad_ftz},
Standard)
1966 addRulesForIOpcs({amdgcn_udot4, amdgcn_sdot4, amdgcn_udot8, amdgcn_sdot8,
1967 amdgcn_dot4_f32_bf8_bf8, amdgcn_dot4_f32_bf8_fp8,
1968 amdgcn_dot4_f32_fp8_fp8, amdgcn_dot4_f32_fp8_bf8},
1973 addRulesForIOpcs({amdgcn_rsq, amdgcn_rsq_clamp},
Standard)
1983 addRulesForIOpcs({amdgcn_mul_u24, amdgcn_mul_i24},
Standard)
1989 addRulesForIOpcs({amdgcn_ds_bpermute, amdgcn_ds_bpermute_fi_b32,
1990 amdgcn_ds_permute, amdgcn_fmul_legacy, amdgcn_mulhi_i24,
1996 addRulesForIOpcs({amdgcn_cvt_sr_bf8_f32, amdgcn_cvt_sr_fp8_f32,
1997 amdgcn_cvt_sr_fp8_f32_e5m3, amdgcn_cvt_pk_bf8_f32,
1998 amdgcn_cvt_pk_fp8_f32, amdgcn_cvt_pk_fp8_f32_e5m3},
2003 addRulesForIOpcs({amdgcn_cvt_off_f32_i4, amdgcn_cvt_f32_bf8,
2004 amdgcn_cvt_f32_fp8, amdgcn_cvt_f32_fp8_e5m3},
2009 addRulesForIOpcs({amdgcn_cvt_pk_f32_bf8, amdgcn_cvt_pk_f32_fp8})
2013 addRulesForIOpcs({amdgcn_cvt_f16_bf8, amdgcn_cvt_f16_fp8},
Standard)
2017 addRulesForIOpcs({amdgcn_cvt_pk_f16_bf8, amdgcn_cvt_pk_f16_fp8},
Standard)
2021 addRulesForIOpcs({amdgcn_cvt_pk_bf8_f16, amdgcn_cvt_pk_fp8_f16},
Standard)
2025 addRulesForIOpcs({amdgcn_cvt_sr_bf8_f16, amdgcn_cvt_sr_fp8_f16},
Standard)
2029 addRulesForIOpcs({amdgcn_cvt_sr_pk_f16_f32},
Standard)
2033 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_fp8_f16})
2036 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_fp8_f32})
2039 addRulesForIOpcs({amdgcn_cubesc, amdgcn_cubetc, amdgcn_cubema, amdgcn_cubeid,
2045 addRulesForIOpcs({amdgcn_frexp_mant, amdgcn_fract},
Standard)
2053 addRulesForIOpcs({amdgcn_prng_b32})
2057 addRulesForIOpcs({amdgcn_sffbh},
Standard)
2061 addRulesForIOpcs({amdgcn_ubfe, amdgcn_sbfe},
Standard)
2067 addRulesForIOpcs({amdgcn_cvt_pk_i16, amdgcn_cvt_pk_u16, amdgcn_cvt_pknorm_i16,
2068 amdgcn_cvt_pknorm_u16},
2073 addRulesForIOpcs({amdgcn_cvt_pkrtz},
Standard)
2078 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk32_bf6_f16,
2079 amdgcn_cvt_scalef32_sr_pk32_fp6_f16,
2080 amdgcn_cvt_scalef32_sr_pk32_bf6_bf16,
2081 amdgcn_cvt_scalef32_sr_pk32_fp6_bf16},
2085 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk32_bf6_f32,
2086 amdgcn_cvt_scalef32_sr_pk32_fp6_f32},
2090 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk_fp4_f16},
Standard)
2094 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk_fp4_f32},
Standard)
2099 {amdgcn_cvt_scalef32_2xpk16_fp6_f32, amdgcn_cvt_scalef32_2xpk16_bf6_f32})
2105 addRulesForIOpcs({amdgcn_cvt_scalef32_f16_fp8, amdgcn_cvt_scalef32_f16_bf8},
2110 addRulesForIOpcs({amdgcn_cvt_scalef32_f32_fp8, amdgcn_cvt_scalef32_f32_bf8},
2116 {amdgcn_cvt_scalef32_pk16_bf6_f16, amdgcn_cvt_scalef32_pk16_fp6_f16},
2122 {amdgcn_cvt_scalef32_pk16_bf6_f32, amdgcn_cvt_scalef32_pk16_fp6_f32},
2128 {amdgcn_cvt_scalef32_pk8_bf8_f16, amdgcn_cvt_scalef32_pk8_fp8_f16},
2134 {amdgcn_cvt_scalef32_pk8_bf8_f32, amdgcn_cvt_scalef32_pk8_fp8_f32},
2139 addRulesForIOpcs({amdgcn_cvt_scalef32_pk8_fp4_f16},
Standard)
2143 addRulesForIOpcs({amdgcn_cvt_scalef32_pk8_fp4_f32},
Standard)
2147 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk16_bf6_f16,
2148 amdgcn_cvt_scalef32_sr_pk16_fp6_f16},
2154 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk16_bf6_f32,
2155 amdgcn_cvt_scalef32_sr_pk16_fp6_f32},
2162 {amdgcn_cvt_scalef32_sr_pk8_bf8_f16, amdgcn_cvt_scalef32_sr_pk8_fp8_f16},
2169 {amdgcn_cvt_scalef32_sr_pk8_bf8_f32, amdgcn_cvt_scalef32_sr_pk8_fp8_f32},
2175 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk8_fp4_f16},
Standard)
2179 addRulesForIOpcs({amdgcn_cvt_scalef32_sr_pk8_fp4_f32},
Standard)
2184 {amdgcn_cvt_scale_pk16_f16_bf6, amdgcn_cvt_scale_pk16_f16_fp6},
Standard)
2189 {amdgcn_cvt_scale_pk16_f32_bf6, amdgcn_cvt_scale_pk16_f32_fp6},
Standard)
2193 addRulesForIOpcs({amdgcn_cvt_scale_pk8_f16_bf8, amdgcn_cvt_scale_pk8_f16_fp8},
2198 addRulesForIOpcs({amdgcn_cvt_scale_pk8_f16_fp4},
Standard)
2202 addRulesForIOpcs({amdgcn_cvt_scale_pk8_f32_bf8, amdgcn_cvt_scale_pk8_f32_fp8},
2207 addRulesForIOpcs({amdgcn_cvt_scale_pk8_f32_fp4},
Standard)
2212 {amdgcn_cvt_scalef32_pk32_bf6_f16, amdgcn_cvt_scalef32_pk32_fp6_f16},
2218 {amdgcn_cvt_scalef32_pk_fp8_f32, amdgcn_cvt_scalef32_pk_bf8_f32},
2225 {amdgcn_cvt_scalef32_pk_f32_fp8, amdgcn_cvt_scalef32_pk_f32_bf8},
2231 {amdgcn_cvt_scalef32_pk_fp8_f16, amdgcn_cvt_scalef32_pk_bf8_f16},
2236 addRulesForIOpcs({amdgcn_cvt_scalef32_pk_f32_fp4},
Standard)
2240 addRulesForIOpcs({amdgcn_cvt_scalef32_pk_fp4_f32},
Standard)
2244 addRulesForIOpcs({amdgcn_cvt_scalef32_pk_f16_fp4,
2245 amdgcn_cvt_scalef32_pk_f16_fp8,
2246 amdgcn_cvt_scalef32_pk_f16_bf8},
2252 {amdgcn_cvt_scalef32_pk32_f32_fp6, amdgcn_cvt_scalef32_pk32_f32_bf6},
2258 {amdgcn_cvt_scalef32_pk32_f16_fp6, amdgcn_cvt_scalef32_pk32_f16_bf6},
2263 addRulesForIOpcs({amdgcn_cvt_scalef32_pk_fp4_f16},
Standard)
2267 addRulesForIOpcs({amdgcn_global_load_tr_b64})
2273 addRulesForIOpcs({amdgcn_global_load_tr_b128})
2279 addRulesForIOpcs({amdgcn_global_load_tr4_b64})
2283 addRulesForIOpcs({amdgcn_global_load_tr6_b96})
2287 addRulesForIOpcs({amdgcn_ds_load_tr4_b64, amdgcn_ds_load_tr8_b64})
2290 addRulesForIOpcs({amdgcn_ds_load_tr6_b96})
2293 addRulesForIOpcs({amdgcn_ds_load_tr16_b128})
2296 addRulesForIOpcs({amdgcn_global_atomic_ordered_add_b64})
2300 {amdgcn_global_atomic_fmin_num, amdgcn_global_atomic_fmax_num},
Standard)
2303 addRulesForIOpcs({amdgcn_flat_atomic_fmin_num, amdgcn_flat_atomic_fmax_num},
2307 addRulesForIOpcs({amdgcn_raw_buffer_load_lds})
2310 addRulesForIOpcs({amdgcn_raw_buffer_load_async_lds})
2313 addRulesForIOpcs({amdgcn_struct_buffer_load_async_lds})
2318 addRulesForIOpcs({amdgcn_struct_buffer_load_lds})
2322 addRulesForIOpcs({amdgcn_raw_ptr_buffer_load_lds})
2325 addRulesForIOpcs({amdgcn_raw_ptr_buffer_load_async_lds})
2328 addRulesForIOpcs({amdgcn_struct_ptr_buffer_load_async_lds})
2332 addRulesForIOpcs({amdgcn_struct_ptr_buffer_load_lds})
2336 {amdgcn_global_load_lds, amdgcn_load_to_lds, amdgcn_load_async_to_lds})
2339 addRulesForIOpcs({amdgcn_global_load_async_to_lds_b8,
2340 amdgcn_global_load_async_to_lds_b32,
2341 amdgcn_global_load_async_to_lds_b64,
2342 amdgcn_global_load_async_to_lds_b128,
2343 amdgcn_global_store_async_from_lds_b8,
2344 amdgcn_global_store_async_from_lds_b32,
2345 amdgcn_global_store_async_from_lds_b64,
2346 amdgcn_global_store_async_from_lds_b128})
2349 addRulesForIOpcs({amdgcn_global_load_async_lds})
2352 addRulesForIOpcs({amdgcn_tensor_load_to_lds, amdgcn_tensor_store_from_lds})
2359 addRulesForIOpcs({amdgcn_cluster_load_b32})
2365 addRulesForIOpcs({amdgcn_cluster_load_b64})
2371 addRulesForIOpcs({amdgcn_cluster_load_b128})
2378 addRulesForIOpcs({amdgcn_cluster_load_async_to_lds_b8,
2379 amdgcn_cluster_load_async_to_lds_b32,
2380 amdgcn_cluster_load_async_to_lds_b64,
2381 amdgcn_cluster_load_async_to_lds_b128})
2384 addRulesForIOpcs({amdgcn_perm_pk16_b4_u4},
StandardB)
2388 addRulesForIOpcs({amdgcn_perm_pk16_b6_u4},
StandardB)
2392 addRulesForIOpcs({amdgcn_perm_pk16_b8_u4},
StandardB)
2396 addRulesForIOpcs({amdgcn_wwm, amdgcn_strict_wwm, amdgcn_wqm, amdgcn_softwqm,
2414 addRulesForIOpcs({amdgcn_kill, amdgcn_wqm_demote})
2417 addRulesForIOpcs({amdgcn_set_inactive},
StandardB)
2420 addRulesForIOpcs({amdgcn_set_inactive_chain_arg},
Standard)
2423 addRulesForIOpcs({amdgcn_cvt_sr_bf16_f32, amdgcn_cvt_sr_f16_f32},
Standard)
2426 addRulesForIOpcs({amdgcn_ballot},
Standard)
2430 addRulesForIOpcs({amdgcn_inverse_ballot})
2434 addRulesForIOpcs({amdgcn_live_mask, amdgcn_ps_live})
2437 addRulesForIOpcs({amdgcn_mov_dpp, amdgcn_mov_dpp8},
StandardB)
2441 addRulesForIOpcs({amdgcn_update_dpp},
StandardB)
2445 addRulesForIOpcs({amdgcn_sin, amdgcn_cos},
Standard)
2451 addRulesForIOpcs({amdgcn_trig_preop},
Standard)
2455 addRulesForIOpcs({amdgcn_exp2},
Standard)
2463 addRulesForIOpcs({amdgcn_rcp, amdgcn_sqrt},
Standard)
2473 addRulesForIOpcs({amdgcn_log},
Standard)
2481 addRulesForIOpcs({amdgcn_ds_atomic_async_barrier_arrive_b64})
2484 addRulesForIOpcs({amdgcn_ds_atomic_barrier_arrive_rtn_b64},
Standard)
2487 addRulesForIOpcs({amdgcn_ds_add_gs_reg_rtn, amdgcn_ds_sub_gs_reg_rtn},
2492 addRulesForIOpcs({amdgcn_ds_append, amdgcn_ds_consume},
Standard)
2497 {amdgcn_ds_bvh_stack_rtn, amdgcn_ds_bvh_stack_push4_pop1_rtn},
Standard)
2500 addRulesForIOpcs({amdgcn_ds_bvh_stack_push8_pop1_rtn},
Standard)
2503 addRulesForIOpcs({amdgcn_ds_bvh_stack_push8_pop2_rtn},
Standard)
2506 addRulesForIOpcs({amdgcn_ds_gws_sema_p, amdgcn_ds_gws_sema_v,
2507 amdgcn_ds_gws_sema_release_all})
2511 {amdgcn_ds_gws_barrier, amdgcn_ds_gws_init, amdgcn_ds_gws_sema_br})
2514 addRulesForIOpcs({amdgcn_ds_ordered_add, amdgcn_ds_ordered_swap},
Standard)
2517 addRulesForIOpcs({amdgcn_ds_swizzle},
Standard)
2521 addRulesForIOpcs({amdgcn_permlane16_var, amdgcn_permlanex16_var},
Standard)
2524 addRulesForIOpcs({amdgcn_permlane16_swap, amdgcn_permlane32_swap},
Standard)
2527 addRulesForIOpcs({amdgcn_permlane64},
StandardB)
2530 addRulesForIOpcs({amdgcn_ds_read_tr4_b64, amdgcn_ds_read_tr8_b64})
2533 addRulesForIOpcs({amdgcn_ds_read_tr6_b96})
2536 addRulesForIOpcs({amdgcn_ds_read_tr16_b64})
2539 addRulesForIOpcs({amdgcn_interp_p1},
Standard)
2542 addRulesForIOpcs({amdgcn_interp_p1_f16},
Standard)
2545 addRulesForIOpcs({amdgcn_interp_p2},
Standard)
2548 addRulesForIOpcs({amdgcn_interp_p2_f16},
Standard)
2552 addRulesForIOpcs({amdgcn_interp_mov},
Standard)
2555 addRulesForIOpcs({amdgcn_interp_inreg_p10, amdgcn_interp_inreg_p2,
2556 amdgcn_interp_inreg_p10_f16, amdgcn_interp_p10_rtz_f16},
2561 addRulesForIOpcs({amdgcn_interp_inreg_p2_f16, amdgcn_interp_p2_rtz_f16},
2566 addRulesForIOpcs({amdgcn_frexp_exp})
2574 addRulesForIOpcs({amdgcn_div_fmas},
Standard)
2580 addRulesForIOpcs({amdgcn_div_fixup},
Standard)
2588 addRulesForIOpcs({amdgcn_div_scale},
Standard)
2594 addRulesForIOpcs({amdgcn_fdot2, amdgcn_sdot2, amdgcn_udot2},
Standard)
2598 addRulesForIOpcs({amdgcn_fdot2_f16_f16},
Standard)
2602 addRulesForIOpcs({amdgcn_sudot4, amdgcn_sudot8},
Standard)
2606 addRulesForIOpcs({amdgcn_s_alloc_vgpr})
2609 addRulesForIOpcs({amdgcn_sat_pk4_i4_i8, amdgcn_sat_pk4_u4_u8},
Standard)
2613 bool HasGFX90AInsts = ST->hasGFX90AInsts();
2616 addRulesForIOpcs({amdgcn_mfma_f32_32x32x1f32, amdgcn_mfma_f32_16x16x1f32,
2617 amdgcn_mfma_f32_4x4x1f32, amdgcn_mfma_f32_32x32x2f32,
2618 amdgcn_mfma_f32_16x16x4f32, amdgcn_mfma_f32_32x32x4f16,
2619 amdgcn_mfma_f32_16x16x4f16, amdgcn_mfma_f32_4x4x4f16,
2620 amdgcn_mfma_f32_32x32x8f16, amdgcn_mfma_f32_16x16x16f16,
2621 amdgcn_mfma_i32_32x32x4i8, amdgcn_mfma_i32_16x16x4i8,
2622 amdgcn_mfma_i32_4x4x4i8, amdgcn_mfma_i32_32x32x8i8,
2623 amdgcn_mfma_i32_16x16x16i8, amdgcn_mfma_f32_32x32x2bf16,
2624 amdgcn_mfma_f32_16x16x2bf16, amdgcn_mfma_f32_4x4x2bf16,
2625 amdgcn_mfma_f32_32x32x4bf16, amdgcn_mfma_f32_16x16x8bf16})
2637 amdgcn_mfma_f32_32x32x4bf16_1k,
2638 amdgcn_mfma_f32_16x16x4bf16_1k,
2639 amdgcn_mfma_f32_4x4x4bf16_1k,
2640 amdgcn_mfma_f32_32x32x8bf16_1k,
2641 amdgcn_mfma_f32_16x16x16bf16_1k,
2642 amdgcn_mfma_f64_16x16x4f64,
2643 amdgcn_mfma_f64_4x4x4f64,
2644 amdgcn_mfma_i32_16x16x32_i8,
2645 amdgcn_mfma_i32_32x32x16_i8,
2646 amdgcn_mfma_f32_16x16x8_xf32,
2647 amdgcn_mfma_f32_32x32x4_xf32,
2648 amdgcn_mfma_f32_16x16x32_bf8_bf8,
2649 amdgcn_mfma_f32_16x16x32_bf8_fp8,
2650 amdgcn_mfma_f32_16x16x32_fp8_bf8,
2651 amdgcn_mfma_f32_16x16x32_fp8_fp8,
2652 amdgcn_mfma_f32_32x32x16_bf8_bf8,
2653 amdgcn_mfma_f32_32x32x16_bf8_fp8,
2654 amdgcn_mfma_f32_32x32x16_fp8_bf8,
2655 amdgcn_mfma_f32_32x32x16_fp8_fp8,
2657 amdgcn_mfma_f32_16x16x32_f16,
2658 amdgcn_mfma_f32_32x32x16_f16,
2659 amdgcn_mfma_i32_16x16x64_i8,
2660 amdgcn_mfma_i32_32x32x32_i8,
2670 amdgcn_smfmac_f32_16x16x32_f16, amdgcn_smfmac_f32_32x32x16_f16,
2671 amdgcn_smfmac_f32_16x16x32_bf16, amdgcn_smfmac_f32_32x32x16_bf16,
2672 amdgcn_smfmac_i32_16x16x64_i8, amdgcn_smfmac_i32_32x32x32_i8,
2673 amdgcn_smfmac_f32_16x16x64_bf8_bf8, amdgcn_smfmac_f32_16x16x64_bf8_fp8,
2674 amdgcn_smfmac_f32_16x16x64_fp8_bf8, amdgcn_smfmac_f32_16x16x64_fp8_fp8,
2675 amdgcn_smfmac_f32_32x32x32_bf8_bf8, amdgcn_smfmac_f32_32x32x32_bf8_fp8,
2676 amdgcn_smfmac_f32_32x32x32_fp8_bf8, amdgcn_smfmac_f32_32x32x32_fp8_fp8,
2678 amdgcn_smfmac_f32_16x16x64_f16, amdgcn_smfmac_f32_32x32x32_f16,
2679 amdgcn_smfmac_i32_16x16x128_i8, amdgcn_smfmac_i32_32x32x64_i8,
2680 amdgcn_smfmac_f32_16x16x128_bf8_bf8, amdgcn_smfmac_f32_16x16x128_bf8_fp8,
2681 amdgcn_smfmac_f32_16x16x128_fp8_bf8, amdgcn_smfmac_f32_16x16x128_fp8_fp8,
2682 amdgcn_smfmac_f32_32x32x64_bf8_bf8, amdgcn_smfmac_f32_32x32x64_bf8_fp8,
2683 amdgcn_smfmac_f32_32x32x64_fp8_bf8, amdgcn_smfmac_f32_32x32x64_fp8_fp8})
2688 addRulesForIOpcs({amdgcn_mfma_scale_f32_32x32x64_f8f6f4,
2689 amdgcn_mfma_scale_f32_16x16x128_f8f6f4})
2698 amdgcn_wmma_f32_16x16x16_f16, amdgcn_wmma_f32_16x16x16_bf16,
2699 amdgcn_wmma_f16_16x16x16_f16, amdgcn_wmma_bf16_16x16x16_bf16,
2700 amdgcn_wmma_f16_16x16x16_f16_tied, amdgcn_wmma_bf16_16x16x16_bf16_tied,
2701 amdgcn_wmma_i32_16x16x16_iu8, amdgcn_wmma_i32_16x16x16_iu4,
2703 amdgcn_wmma_f32_16x16x16_fp8_fp8, amdgcn_wmma_f32_16x16x16_fp8_bf8,
2704 amdgcn_wmma_f32_16x16x16_bf8_fp8, amdgcn_wmma_f32_16x16x16_bf8_bf8,
2705 amdgcn_wmma_i32_16x16x32_iu4,
2707 amdgcn_wmma_f32_16x16x4_f32, amdgcn_wmma_f32_16x16x32_bf16,
2708 amdgcn_wmma_f32_16x16x32_f16, amdgcn_wmma_f16_16x16x32_f16,
2709 amdgcn_wmma_bf16_16x16x32_bf16, amdgcn_wmma_bf16f32_16x16x32_bf16,
2710 amdgcn_wmma_f32_16x16x64_fp8_fp8, amdgcn_wmma_f32_16x16x64_fp8_bf8,
2711 amdgcn_wmma_f32_16x16x64_bf8_fp8, amdgcn_wmma_f32_16x16x64_bf8_bf8,
2712 amdgcn_wmma_f16_16x16x64_fp8_fp8, amdgcn_wmma_f16_16x16x64_fp8_bf8,
2713 amdgcn_wmma_f16_16x16x64_bf8_fp8, amdgcn_wmma_f16_16x16x64_bf8_bf8,
2714 amdgcn_wmma_f16_16x16x128_fp8_fp8, amdgcn_wmma_f16_16x16x128_fp8_bf8,
2715 amdgcn_wmma_f16_16x16x128_bf8_fp8, amdgcn_wmma_f16_16x16x128_bf8_bf8,
2716 amdgcn_wmma_f32_16x16x128_fp8_fp8, amdgcn_wmma_f32_16x16x128_fp8_bf8,
2717 amdgcn_wmma_f32_16x16x128_bf8_fp8, amdgcn_wmma_f32_16x16x128_bf8_bf8,
2718 amdgcn_wmma_i32_16x16x64_iu8, amdgcn_wmma_f32_16x16x128_f8f6f4,
2719 amdgcn_wmma_scale_f32_16x16x128_f8f6f4,
2720 amdgcn_wmma_scale16_f32_16x16x128_f8f6f4, amdgcn_wmma_f32_32x16x128_f4,
2721 amdgcn_wmma_scale_f32_32x16x128_f4, amdgcn_wmma_scale16_f32_32x16x128_f4,
2723 amdgcn_wmma_f64_16x16x4_f64,
2725 amdgcn_swmmac_f32_16x16x32_f16, amdgcn_swmmac_f32_16x16x32_bf16,
2726 amdgcn_swmmac_f16_16x16x32_f16, amdgcn_swmmac_bf16_16x16x32_bf16,
2727 amdgcn_swmmac_i32_16x16x32_iu8, amdgcn_swmmac_i32_16x16x32_iu4,
2728 amdgcn_swmmac_i32_16x16x64_iu4, amdgcn_swmmac_f32_16x16x32_fp8_fp8,
2729 amdgcn_swmmac_f32_16x16x32_fp8_bf8, amdgcn_swmmac_f32_16x16x32_bf8_fp8,
2730 amdgcn_swmmac_f32_16x16x32_bf8_bf8,
2732 amdgcn_swmmac_f32_16x16x64_f16, amdgcn_swmmac_f32_16x16x64_bf16,
2733 amdgcn_swmmac_f16_16x16x64_f16, amdgcn_swmmac_bf16_16x16x64_bf16,
2734 amdgcn_swmmac_bf16f32_16x16x64_bf16, amdgcn_swmmac_f32_16x16x128_fp8_fp8,
2735 amdgcn_swmmac_f32_16x16x128_fp8_bf8, amdgcn_swmmac_f32_16x16x128_bf8_fp8,
2736 amdgcn_swmmac_f32_16x16x128_bf8_bf8, amdgcn_swmmac_f16_16x16x128_fp8_fp8,
2737 amdgcn_swmmac_f16_16x16x128_fp8_bf8, amdgcn_swmmac_f16_16x16x128_bf8_fp8,
2738 amdgcn_swmmac_f16_16x16x128_bf8_bf8, amdgcn_swmmac_i32_16x16x128_iu8})