[Mlir-commits] [flang] [mlir] [flang][mlir] Add support for implicit linearization in omp.simd (PR #150386)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Jul 24 04:18:45 PDT 2025


================
@@ -146,6 +146,27 @@ class LinearClauseProcessor {
   llvm::BasicBlock *linearLastIterExitBB;
 
 public:
+  // Allocate space for linear variabes
----------------
NimishMishra wrote:

It is actually `llvm::Value *linearVar` and `mlir::Value &linearVar`. These functions are overloaded because in case of implicit linearization, the FIR lowering has already performed privatization. From lines 2893 - 2910, if a linear variable also exists as a private variable, we directly linearize a `llvm::Value *`. If not, then we have a `mlir::Value` which to process.

But now that I detail this, I realise that maybe in the second case, I could invoke ModuleTranslation to lookup the `llvm::Value` for the `mlir::Value` and use the same function.

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


More information about the Mlir-commits mailing list