[Mlir-commits] [mlir] [mlir][OpenMP] Standardise representation of reduction clause (PR #96215)
Sergio Afonso
llvmlistbot at llvm.org
Wed Jun 26 05:52:45 PDT 2024
================
@@ -568,18 +573,22 @@ static void printParallelRegion(OpAsmPrinter &p, Operation *op, Region ®ion,
static ParseResult
parseReductionVarList(OpAsmParser &parser,
SmallVectorImpl<OpAsmParser::UnresolvedOperand> &operands,
- SmallVectorImpl<Type> &types,
+ SmallVectorImpl<Type> &types, DenseBoolArrayAttr &isByRef,
ArrayAttr &redcuctionSymbols) {
SmallVector<SymbolRefAttr> reductionVec;
+ SmallVector<bool> isByRefVec;
if (failed(parser.parseCommaSeparatedList([&]() {
+ ParseResult optionalByref = parser.parseOptionalKeyword("byref");
if (parser.parseAttribute(reductionVec.emplace_back()) ||
parser.parseArrow() ||
parser.parseOperand(operands.emplace_back()) ||
parser.parseColonType(types.emplace_back()))
return failure();
+ isByRefVec.push_back(optionalByref.succeeded());
return success();
})))
return failure();
+ isByRef = DenseBoolArrayAttr::get(parser.getContext(), isByRefVec);
----------------
skatrak wrote:
```suggestion
isByRef = makeDenseBoolArrayAttr(parser.getContext(), isByRefVec);
```
https://github.com/llvm/llvm-project/pull/96215
More information about the Mlir-commits
mailing list