[clang] [OpenACC][CIR] Lower 'num_workers' for parallel/kernels (PR #136578)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 21 11:53:29 PDT 2025


================
@@ -109,14 +126,15 @@ class OpenACCClauseCIREmitter final
   }
 
   void VisitDeviceTypeClause(const OpenACCDeviceTypeClause &clause) {
+    lastDeviceTypeClause = &clause;
     if constexpr (isOneOfTypes<OpTy, InitOp, ShutdownOp>) {
       llvm::SmallVector<mlir::Attribute> deviceTypes;
       std::optional<mlir::ArrayAttr> existingDeviceTypes =
           operation.getDeviceTypes();
 
       // Ensure we keep the existing ones, and in the correct 'new' order.
       if (existingDeviceTypes) {
-        for (const mlir::Attribute &Attr : *existingDeviceTypes)
+        for (mlir::Attribute Attr : *existingDeviceTypes)
----------------
andykaylor wrote:

```suggestion
        for (mlir::Attribute attr : *existingDeviceTypes)
```

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


More information about the cfe-commits mailing list