[llvm-branch-commits] [flang] [Flang][OpenMP] Refactor loop-related lowering for composite support (PR #97566)

Tom Eccles via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jul 4 03:42:24 PDT 2024


https://github.com/tblah commented:

This looks good overall. Do you expect there to be a lot more wrapper operations in the near future? If so, they look like there is a common pattern that could be further abstracted. Something like

```c++
template <class OP>
static OP
genWrapperOp(..., llvm::ArrayRef<mlir::type> extraBlockArgTypes) {
  fir::FirOpBuilder &firOpBuilder = ...;

  auto op = firOpBuilder.create<OP>(loc, clauseOps);

  llvm::SmallVector<mlir::Location> blockArgLocs(extraBlockArgTypes.size(), loc);
  firOpBuilder.createBlock(...)
  firOpBuilder.setInsertionPoint(...)

  return op;
}
```

https://github.com/llvm/llvm-project/pull/97566


More information about the llvm-branch-commits mailing list