[Mlir-commits] [flang] [mlir] [flang][mlir][OpenMP] Add support for uniform clause in declare simd (PR #176046)

Tom Eccles llvmlistbot at llvm.org
Mon Jan 19 08:50:15 PST 2026


================
@@ -1446,6 +1446,38 @@ void OmpStructureChecker::Enter(const parser::OpenMPDeclareSimdConstruct &x) {
   const parser::OmpDirectiveName &dirName{x.v.DirName()};
   PushContextAndClauseSets(dirName.source, dirName.v);
 
+  const Scope &containingScope = context_.FindScope(dirName.source);
+  const Scope &progUnitScope = GetProgramUnitContaining(containingScope);
+
+  for (const parser::OmpClause &clause : x.v.Clauses().v) {
+    llvm::omp::Clause id{clause.Id()};
+    if (id != llvm::omp::Clause::OMPC_uniform) {
+      continue;
+    }
+    const auto *u = std::get_if<parser::OmpClause::Uniform>(&clause.u);
+    if (!u) {
+      continue;
+    }
----------------
tblah wrote:

I'm not sure we need both the id check and a get_if. If the two don't match that can be an assertion failure.

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


More information about the Mlir-commits mailing list