This patch adds the critical construct to the OpenMP dialect. The
implementation models the definition in 2.17.1 of the OpenMP 5 standard.
A name and hint can be specified. The name is a global entity or has
external linkage, it is modelled as a FlatSymbolRefAttr. Hint is
modelled as an integer enum attribute.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td | ||
---|---|---|
373 | structure? | |
378 | Ultra-nit: please align this line vertically with something. | |
mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp | ||
243 | Nit: isn't there a getValueOr() ? | |
mlir/test/Dialect/OpenMP/invalid.mlir | ||
301 | Do we really want printed names this long? Can't we just have nonspeculative here? |
Address review comments. Changes include,
-> Using shorter names for hint clause values.
-> Formatting and corrections to description.
-> Using getValueOr in place of hasValue, getValue etc.
mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp | ||
---|---|---|
243 | Yes. Thanks for pointing this out. Fixed. | |
mlir/test/Dialect/OpenMP/invalid.mlir | ||
301 | I have switched to using nonspeculative instead of omp_sync_hint_nonspeculative here. I agree that from a pure readability and mlir perspective it is good to use short names. Two reasons for using the long name in the first version,
Using long names, can help avoid such issues. |
structure?