[PATCH] D110270: [flang][OpenMP] Check for occurrence of multiple list items in nontemporal clause for simd directive

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 23 01:57:46 PDT 2021


kiranchandramohan requested changes to this revision.
kiranchandramohan added a comment.
This revision now requires changes to proceed.

Thanks @arnamoy10 for this patch. A few comments.



================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:176
+  auto alignedClauses = FindClauses(llvm::omp::Clause::OMPC_aligned);
+  auto nonTemporalClauses = FindClauses(llvm::omp::Clause::OMPC_nontemporal);
+
----------------
Move this close to its use. Use braced initialization in all places (here, the line above, for loop variable etc).


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:184-192
+    for (auto const &var : alignedNameList) {
+      if (listVars.count(*(var.symbol)) == 1) {
+        context_.Say(itr->second->source,
+            "List item '%s' present at multiple ALIGNED clauses"_err_en_US,
+            var.ToString());
+        break;
+      }
----------------
Can you make this a lambda function that takes in a list of variables, with listvars declared inside the lambda and an argument (pass ALIGNED or NONTEMPORAL to it)?


================
Comment at: flang/lib/Semantics/check-omp-structure.cpp:189
+            var.ToString());
+        break;
+      }
----------------
Should this break be removed to capture all errors?
!$omp simd nontemporal(a,a,b,b)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110270/new/

https://reviews.llvm.org/D110270



More information about the llvm-commits mailing list