[clang] [OpenACC][CIR] Implement 'modifier-list' lowering (PR #145770)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 26 06:21:42 PDT 2025


================
@@ -286,16 +286,28 @@ class OpenACCClauseCIREmitter final
             std::move(bounds)};
   }
 
+  mlir::acc::DataClauseModifier
+  convertModifiers(OpenACCModifierKind modifiers) {
+    using namespace mlir::acc;
+    DataClauseModifier mlirModifiers{};
+
+    // The MLIR representation of this represents `always` as `alwaysin` +
+    // `alwaysout`.  So do a small fixup here.
+    if (isOpenACCModifierBitSet(modifiers, OpenACCModifierKind::Always)) {
----------------
erichkeane wrote:

Unfortunately not on the using the same type.  The FE and the MLIR have different needs when it comes to tracking `always`.  CFE needs to differentiate `always` from someone typing `alwaysin` and `alwaysout` for diagnostics purposes.  The MLIR passes need `always`->`alwaysin|alwaysout` to ensure they don't miss opt.

The static assert however is a great idea!

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


More information about the cfe-commits mailing list