@@ -2434,57 +2434,44 @@ def : GCNPat <
24342434 (V_RCP_IFLAG_F32_e32 (V_CVT_F32_U32_e32 $src0))))
24352435>;
24362436
2437- multiclass SI_WATERFALL_Pattern < ValueType dvt, ValueType svt, string VecSize> {
2438- def : GCNPat<
2439- (i32 (int_amdgcn_waterfall_begin i32:$tok, svt:$idx)),
2440- (!cast<Instruction>("SI_WATERFALL_BEGIN_"#VecSize) i32:$tok, svt:$idx)
2441- >;
2442-
2443- def : GCNPat<
2444- (dvt (int_amdgcn_waterfall_readfirstlane i32:$tok, svt:$src)),
2445- (!cast<Instruction>("SI_WATERFALL_READFIRSTLANE_"#VecSize) i32:$tok, svt:$src)
2446- >;
2447-
2448- def : GCNPat<
2449- (svt (int_amdgcn_waterfall_end i32:$tok, svt:$src)),
2450- (!cast<Instruction>("SI_WATERFALL_END_"#VecSize) i32:$tok, svt:$src)
2451- >;
2452- }
2453-
2454- multiclass SI_WATERFALL_S_Pattern < ValueType svt, string VecSize> {
2455- def : GCNPat<
2456- (i32 (int_amdgcn_waterfall_begin i32:$tok, svt:$idx)),
2457- (!cast<Instruction>("SI_WATERFALL_BEGIN_"#VecSize) i32:$tok, svt:$idx)
2458- >;
2459-
2460- def : GCNPat<
2461- (svt (int_amdgcn_waterfall_readfirstlane i32:$tok, svt:$src)),
2462- (!cast<Instruction>("SI_WATERFALL_READFIRSTLANE_"#VecSize) i32:$tok, svt:$src)
2463- >;
2464-
2465- def : GCNPat<
2466- (svt (int_amdgcn_waterfall_end i32:$tok, svt:$src)),
2467- (!cast<Instruction>("SI_WATERFALL_END_"#VecSize) i32:$tok, svt:$src)
2468- >;
2469-
2470- def : GCNPat<
2471- (svt (int_amdgcn_waterfall_last_use i32:$tok, svt:$src)),
2472- (!cast<Instruction>("SI_WATERFALL_LAST_USE_"#VecSize) i32:$tok, svt:$src)
2473- >;
2474- def : GCNPat<
2475- (svt (int_amdgcn_waterfall_last_use_vgpr i32:$tok, svt:$src)),
2476- (!cast<Instruction>("SI_WATERFALL_LAST_USE_"#VecSize#"_V") i32:$tok, svt:$src)
2477- >;
2437+ multiclass SI_WATERFALL_Pattern<ValueType dvt, ValueType svt, string VecSize> {
2438+ def : GCNPat<(dvt(int_amdgcn_waterfall_readfirstlane i32:$tok, svt:$src)),
2439+ (!cast<Instruction>("SI_WATERFALL_READFIRSTLANE_"#VecSize)
2440+ i32:$tok,
2441+ svt:$src)>;
2442+ }
2443+
2444+ multiclass SI_WATERFALL_S_Pattern<list<ValueType> vts, string VecSize> {
2445+ foreach vt = vts in {
2446+ def : GCNPat<(i32(int_amdgcn_waterfall_begin i32:$tok, vt:$idx)),
2447+ (!cast<Instruction>("SI_WATERFALL_BEGIN_"#VecSize) i32:$tok,
2448+ vt:$idx)>;
2449+
2450+ def : GCNPat<(vt(int_amdgcn_waterfall_readfirstlane i32:$tok, vt:$src)),
2451+ (!cast<Instruction>("SI_WATERFALL_READFIRSTLANE_"#VecSize)
2452+ i32:$tok,
2453+ vt:$src)>;
2454+
2455+ def : GCNPat<(vt(int_amdgcn_waterfall_end i32:$tok, vt:$src)),
2456+ (!cast<Instruction>("SI_WATERFALL_END_"#VecSize) i32:$tok,
2457+ vt:$src)>;
2458+
2459+ def : GCNPat<(vt(int_amdgcn_waterfall_last_use i32:$tok, vt:$src)),
2460+ (!cast<Instruction>("SI_WATERFALL_LAST_USE_"#VecSize) i32:$tok,
2461+ vt:$src)>;
2462+
2463+ def : GCNPat<(vt(int_amdgcn_waterfall_last_use_vgpr i32:$tok, vt:$src)),
2464+ (!cast<Instruction>("SI_WATERFALL_LAST_USE_"#VecSize#"_V")
2465+ i32:$tok,
2466+ vt:$src)>;
2467+ }
24782468}
24792469
2480- defm : SI_WATERFALL_S_Pattern <i16, "V1">;
2481- defm : SI_WATERFALL_S_Pattern <v2i16, "V1">;
2482- defm : SI_WATERFALL_S_Pattern <v4i16, "V2">;
2483-
2484- defm : SI_WATERFALL_S_Pattern <i32, "V1">;
2485- defm : SI_WATERFALL_S_Pattern <v2i32, "V2">;
2486- defm : SI_WATERFALL_S_Pattern <v4i32, "V4">;
2487- defm : SI_WATERFALL_S_Pattern <v8i32, "V8">;
2470+ defm : SI_WATERFALL_S_Pattern<Reg16Types.types, "V1">;
2471+ defm : SI_WATERFALL_S_Pattern<Reg32Types.types, "V1">;
2472+ defm : SI_WATERFALL_S_Pattern<Reg64Types.types, "V2">;
2473+ defm : SI_WATERFALL_S_Pattern<Reg128Types.types, "V4">;
2474+ defm : SI_WATERFALL_S_Pattern<Reg256Types.types, "V8">;
24882475
24892476defm : SI_WATERFALL_Pattern <i16, f16, "V1">;
24902477defm : SI_WATERFALL_Pattern <v2i16, v2f16, "V1">;
0 commit comments