From fcb91fb0b9947173feb89097871e5d70a5cc1174 Mon Sep 17 00:00:00 2001 From: Tim Shen Date: Fri, 31 Jul 2020 13:58:01 -0700 Subject: [PATCH] [MLIR] Add conversion between XLA Fusion and MHLO FusionOp. PiperOrigin-RevId: 324279065 --- include/mlir-hlo/Dialect/mhlo/IR/hlo_ops.td | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/mlir-hlo/Dialect/mhlo/IR/hlo_ops.td b/include/mlir-hlo/Dialect/mhlo/IR/hlo_ops.td index 3d7b827..e2c9a1a 100644 --- a/include/mlir-hlo/Dialect/mhlo/IR/hlo_ops.td +++ b/include/mlir-hlo/Dialect/mhlo/IR/hlo_ops.td @@ -40,6 +40,14 @@ class HLO_Op traits> : let verifier = [{ return Verify(*this); }]; } +def HLO_LOOP_FUSION : StrEnumAttrCase<"kLoop">; +def HLO_INPUT_FUSION : StrEnumAttrCase<"kInput">; +def HLO_OUTPUT_FUSION : StrEnumAttrCase<"kOutput">; +def HLO_CUSTOM_FUSION : StrEnumAttrCase<"kCustom">; +def HLO_FusionKindAttr : StrEnumAttr<"FusionKind", "fusion kind", [ + HLO_LOOP_FUSION, HLO_INPUT_FUSION, HLO_OUTPUT_FUSION, HLO_CUSTOM_FUSION +]>; + //===----------------------------------------------------------------------===// // MHLO nullary op definitions. //===----------------------------------------------------------------------===// @@ -1375,7 +1383,8 @@ def HLO_FusionOp : HLO_Op<"fusion", []> { let regions = (region SizedRegion<1>:$fused_computation); let arguments = (ins - Variadic:$operands + Variadic:$operands, + OptionalAttr:$fusion_kind ); let results = (outs