@@ -2551,57 +2551,44 @@ def : GCNPat <
25512551 (V_RCP_IFLAG_F32_e32 (V_CVT_F32_U32_e32 $src0))))
25522552>;
25532553
2554- multiclass SI_WATERFALL_Pattern < ValueType dvt, ValueType svt, string VecSize> {
2555- def : GCNPat<
2556- (i32 (int_amdgcn_waterfall_begin i32:$tok, svt:$idx)),
2557- (!cast<Instruction>("SI_WATERFALL_BEGIN_"#VecSize) i32:$tok, svt:$idx)
2558- >;
2559-
2560- def : GCNPat<
2561- (dvt (int_amdgcn_waterfall_readfirstlane i32:$tok, svt:$src)),
2562- (!cast<Instruction>("SI_WATERFALL_READFIRSTLANE_"#VecSize) i32:$tok, svt:$src)
2563- >;
2564-
2565- def : GCNPat<
2566- (svt (int_amdgcn_waterfall_end i32:$tok, svt:$src)),
2567- (!cast<Instruction>("SI_WATERFALL_END_"#VecSize) i32:$tok, svt:$src)
2568- >;
2569- }
2570-
2571- multiclass SI_WATERFALL_S_Pattern < ValueType svt, string VecSize> {
2572- def : GCNPat<
2573- (i32 (int_amdgcn_waterfall_begin i32:$tok, svt:$idx)),
2574- (!cast<Instruction>("SI_WATERFALL_BEGIN_"#VecSize) i32:$tok, svt:$idx)
2575- >;
2576-
2577- def : GCNPat<
2578- (svt (int_amdgcn_waterfall_readfirstlane i32:$tok, svt:$src)),
2579- (!cast<Instruction>("SI_WATERFALL_READFIRSTLANE_"#VecSize) i32:$tok, svt:$src)
2580- >;
2581-
2582- def : GCNPat<
2583- (svt (int_amdgcn_waterfall_end i32:$tok, svt:$src)),
2584- (!cast<Instruction>("SI_WATERFALL_END_"#VecSize) i32:$tok, svt:$src)
2585- >;
2586-
2587- def : GCNPat<
2588- (svt (int_amdgcn_waterfall_last_use i32:$tok, svt:$src)),
2589- (!cast<Instruction>("SI_WATERFALL_LAST_USE_"#VecSize) i32:$tok, svt:$src)
2590- >;
2591- def : GCNPat<
2592- (svt (int_amdgcn_waterfall_last_use_vgpr i32:$tok, svt:$src)),
2593- (!cast<Instruction>("SI_WATERFALL_LAST_USE_"#VecSize#"_V") i32:$tok, svt:$src)
2594- >;
2554+ multiclass SI_WATERFALL_Pattern<ValueType dvt, ValueType svt, string VecSize> {
2555+ def : GCNPat<(dvt(int_amdgcn_waterfall_readfirstlane i32:$tok, svt:$src)),
2556+ (!cast<Instruction>("SI_WATERFALL_READFIRSTLANE_"#VecSize)
2557+ i32:$tok,
2558+ svt:$src)>;
2559+ }
2560+
2561+ multiclass SI_WATERFALL_S_Pattern<list<ValueType> vts, string VecSize> {
2562+ foreach vt = vts in {
2563+ def : GCNPat<(i32(int_amdgcn_waterfall_begin i32:$tok, vt:$idx)),
2564+ (!cast<Instruction>("SI_WATERFALL_BEGIN_"#VecSize) i32:$tok,
2565+ vt:$idx)>;
2566+
2567+ def : GCNPat<(vt(int_amdgcn_waterfall_readfirstlane i32:$tok, vt:$src)),
2568+ (!cast<Instruction>("SI_WATERFALL_READFIRSTLANE_"#VecSize)
2569+ i32:$tok,
2570+ vt:$src)>;
2571+
2572+ def : GCNPat<(vt(int_amdgcn_waterfall_end i32:$tok, vt:$src)),
2573+ (!cast<Instruction>("SI_WATERFALL_END_"#VecSize) i32:$tok,
2574+ vt:$src)>;
2575+
2576+ def : GCNPat<(vt(int_amdgcn_waterfall_last_use i32:$tok, vt:$src)),
2577+ (!cast<Instruction>("SI_WATERFALL_LAST_USE_"#VecSize) i32:$tok,
2578+ vt:$src)>;
2579+
2580+ def : GCNPat<(vt(int_amdgcn_waterfall_last_use_vgpr i32:$tok, vt:$src)),
2581+ (!cast<Instruction>("SI_WATERFALL_LAST_USE_"#VecSize#"_V")
2582+ i32:$tok,
2583+ vt:$src)>;
2584+ }
25952585}
25962586
2597- defm : SI_WATERFALL_S_Pattern <i16, "V1">;
2598- defm : SI_WATERFALL_S_Pattern <v2i16, "V1">;
2599- defm : SI_WATERFALL_S_Pattern <v4i16, "V2">;
2600-
2601- defm : SI_WATERFALL_S_Pattern <i32, "V1">;
2602- defm : SI_WATERFALL_S_Pattern <v2i32, "V2">;
2603- defm : SI_WATERFALL_S_Pattern <v4i32, "V4">;
2604- defm : SI_WATERFALL_S_Pattern <v8i32, "V8">;
2587+ defm : SI_WATERFALL_S_Pattern<Reg16Types.types, "V1">;
2588+ defm : SI_WATERFALL_S_Pattern<Reg32Types.types, "V1">;
2589+ defm : SI_WATERFALL_S_Pattern<Reg64Types.types, "V2">;
2590+ defm : SI_WATERFALL_S_Pattern<Reg128Types.types, "V4">;
2591+ defm : SI_WATERFALL_S_Pattern<Reg256Types.types, "V8">;
26052592
26062593defm : SI_WATERFALL_Pattern <i16, f16, "V1">;
26072594defm : SI_WATERFALL_Pattern <v2i16, v2f16, "V1">;
0 commit comments