From 0b1cd03dbb778026995436e1f29b7dbc8c8e95bc Mon Sep 17 00:00:00 2001 From: Valentin Clement Date: Tue, 16 May 2023 15:13:32 -0700 Subject: [PATCH] [mlir][openacc][NFC] Rename ReductionOp to ReductionOperator As we are moving on with new design for the private clause representation, the reduction clause will aslo get remodeled. In order to new clash with a new dedicated reduction operation, this patch rename the current ReductionOp to ReductionOperator. It might just become obsolete once the new design is in place. Reviewed By: razvanlupusoru Differential Revision: https://reviews.llvm.org/D150711 --- mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td | 48 +++++++++++++------------ 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td index f920f7e..7beec7f 100644 --- a/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td +++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td @@ -30,31 +30,33 @@ class OpenACC_Op traits = []> : Op; // Reduction operation enumeration. -def OpenACC_ReductionOpAdd : I32EnumAttrCase<"redop_add", 0>; -def OpenACC_ReductionOpMul : I32EnumAttrCase<"redop_mul", 1>; -def OpenACC_ReductionOpMax : I32EnumAttrCase<"redop_max", 2>; -def OpenACC_ReductionOpMin : I32EnumAttrCase<"redop_min", 3>; -def OpenACC_ReductionOpAnd : I32EnumAttrCase<"redop_and", 4>; -def OpenACC_ReductionOpOr : I32EnumAttrCase<"redop_or", 5>; -def OpenACC_ReductionOpXor : I32EnumAttrCase<"redop_xor", 6>; -def OpenACC_ReductionOpLogEqv : I32EnumAttrCase<"redop_leqv", 7>; -def OpenACC_ReductionOpLogNeqv : I32EnumAttrCase<"redop_lneqv", 8>; -def OpenACC_ReductionOpLogAnd : I32EnumAttrCase<"redop_land", 9>; -def OpenACC_ReductionOpLogOr : I32EnumAttrCase<"redop_lor", 10>; - -def OpenACC_ReductionOp : I32EnumAttr<"ReductionOp", +def OpenACC_ReductionOperatorAdd : I32EnumAttrCase<"redop_add", 0>; +def OpenACC_ReductionOperatorMul : I32EnumAttrCase<"redop_mul", 1>; +def OpenACC_ReductionOperatorMax : I32EnumAttrCase<"redop_max", 2>; +def OpenACC_ReductionOperatorMin : I32EnumAttrCase<"redop_min", 3>; +def OpenACC_ReductionOperatorAnd : I32EnumAttrCase<"redop_and", 4>; +def OpenACC_ReductionOperatorOr : I32EnumAttrCase<"redop_or", 5>; +def OpenACC_ReductionOperatorXor : I32EnumAttrCase<"redop_xor", 6>; +def OpenACC_ReductionOperatorLogEqv : I32EnumAttrCase<"redop_leqv", 7>; +def OpenACC_ReductionOperatorLogNeqv : I32EnumAttrCase<"redop_lneqv", 8>; +def OpenACC_ReductionOperatorLogAnd : I32EnumAttrCase<"redop_land", 9>; +def OpenACC_ReductionOperatorLogOr : I32EnumAttrCase<"redop_lor", 10>; + +def OpenACC_ReductionOperator : I32EnumAttr<"ReductionOperator", "built-in reduction operations supported by OpenACC", - [OpenACC_ReductionOpAdd, OpenACC_ReductionOpMul, OpenACC_ReductionOpMax, - OpenACC_ReductionOpMin, OpenACC_ReductionOpAnd, OpenACC_ReductionOpOr, - OpenACC_ReductionOpXor, OpenACC_ReductionOpLogEqv, - OpenACC_ReductionOpLogNeqv, OpenACC_ReductionOpLogAnd, - OpenACC_ReductionOpLogOr + [OpenACC_ReductionOperatorAdd, OpenACC_ReductionOperatorMul, + OpenACC_ReductionOperatorMax, OpenACC_ReductionOperatorMin, + OpenACC_ReductionOperatorAnd, OpenACC_ReductionOperatorOr, + OpenACC_ReductionOperatorXor, OpenACC_ReductionOperatorLogEqv, + OpenACC_ReductionOperatorLogNeqv, OpenACC_ReductionOperatorLogAnd, + OpenACC_ReductionOperatorLogOr ]> { let genSpecializedAttr = 0; let cppNamespace = "::mlir::acc"; } -def OpenACC_ReductionOpAttr : EnumAttr; +def OpenACC_ReductionOperatorAttr : EnumAttr; // Type used in operation below. def IntOrIndex : AnyTypeOf<[AnyInteger, Index]>; @@ -428,7 +430,7 @@ def OpenACC_ParallelOp : OpenACC_Op<"parallel", Optional:$ifCond, Optional:$selfCond, UnitAttr:$selfAttr, - OptionalAttr:$reductionOp, + OptionalAttr:$reductionOp, Variadic:$reductionOperands, Variadic:$gangPrivateOperands, Variadic:$gangFirstPrivateOperands, @@ -493,7 +495,7 @@ def OpenACC_SerialOp : OpenACC_Op<"serial", Optional:$ifCond, Optional:$selfCond, UnitAttr:$selfAttr, - OptionalAttr:$reductionOp, + OptionalAttr:$reductionOp, Variadic:$reductionOperands, Variadic:$gangPrivateOperands, Variadic:$gangFirstPrivateOperands, @@ -828,7 +830,7 @@ def OpenACC_LoopOp : OpenACC_Op<"loop", UnitAttr:$hasVector, Variadic:$tileOperands, Variadic:$privateOperands, - OptionalAttr:$reductionOp, + OptionalAttr:$reductionOp, Variadic:$reductionOperands); let results = (outs Variadic:$results); -- 2.7.4