[flang-commits] [flang] [mlir] [OpenMP] [MLIR] [Flang] Replace all uses of variables in ALLOCATE directive to use new value which is created. (PR #212361)

Pranav Bhandarkar via flang-commits flang-commits at lists.llvm.org
Thu Jul 30 04:31:01 PDT 2026


================
@@ -9660,6 +9711,17 @@ convertAllocateDirOp(Operation &opInst, llvm::IRBuilderBase &builder,
     }
     // Record the alloc pointer keyed by the MLIR variable value.
     ompIface.registerAllocatedPtr(var, allocCall);
+
+    Value baseVar = getBaseValueForTypeLookup(var);
----------------
bhandarkar-pranav wrote:

nit: Would it make sense to compute `baseVar` early? It seems like it is needed in a couple of different places. Here and also in `getDynamicAllocatedSize` and `getAllocatedLlvmTypeForVar`. Might as well compute it and then pass it to these functions. But this is really a nit.

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


More information about the flang-commits mailing list