[flang-commits] [flang] [flang][OpenMP] Extend `do concurrent` mapping to device (PR #155987)

Pranav Bhandarkar via flang-commits flang-commits at lists.llvm.org
Mon Sep 8 22:00:30 PDT 2025


================
@@ -107,6 +112,33 @@ struct InductionVariableInfo {
 
 using InductionVariableInfos = llvm::SmallVector<InductionVariableInfo>;
 
+/// Collect the list of values used inside the loop but defined outside of it.
+void collectLoopLiveIns(fir::DoConcurrentLoopOp loop,
+                        llvm::SmallVectorImpl<mlir::Value> &liveIns) {
+  llvm::SmallDenseSet<mlir::Value> seenValues;
+  llvm::SmallDenseSet<mlir::Operation *> seenOps;
----------------
bhandarkar-pranav wrote:

nit: Prefer `llvm::SmallPtrSet` as per the [LLVM Programmer's manual](https://llvm.org/docs/ProgrammersManual.html#llvm-adt-smallptrset-h)


> DenseSet is a great way to unique small values that are not simple pointers (use [SmallPtrSet](https://llvm.org/docs/ProgrammersManual.html#dss-smallptrset) for pointers)

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


More information about the flang-commits mailing list