[clang] [mlir] [OpenACC] Implement tile/collapse lowering (PR #138576)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue May 6 10:10:22 PDT 2025


================
@@ -82,6 +83,17 @@ class OpenACCClauseCIREmitter final
     return conversionOp.getResult(0);
   }
 
+  mlir::Value createConstantInt(mlir::Location loc, unsigned width,
+                                int64_t value) {
+    mlir::IntegerType ty = mlir::IntegerType::get(
+        &cgf.getMLIRContext(), width,
+        mlir::IntegerType::SignednessSemantics::Signless);
+    auto constOp = builder.create<mlir::arith::ConstantOp>(
----------------
erichkeane wrote:

At the moment it looks like we're pretty close to the end of what I'll have to do here.  There are a couple of clauses that just take ints, so we do those conversions above, another constant or two, but they are pretty rote?  I don't know if the work for a pass to just do a couple of type conversions would be particularly beneficial.

BUT it is definitely something I want to keep  in mind.

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


More information about the cfe-commits mailing list