[flang-commits] [flang] [flang] Implement !DIR$ UNROLL [N] (PR #123331)

via flang-commits flang-commits at lists.llvm.org
Mon Jan 20 00:58:57 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 95ff3b51672e970e1b69ca438a97d733cdd82566 84e1a296c32e0f69d9862aaf5e16abc7a4fc3f7e --extensions h,cpp -- flang/include/flang/Parser/dump-parse-tree.h flang/include/flang/Parser/parse-tree.h flang/lib/Lower/Bridge.cpp flang/lib/Parser/Fortran-parsers.cpp flang/lib/Parser/unparse.cpp flang/lib/Semantics/canonicalize-directives.cpp flang/lib/Semantics/resolve-names.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index 610c7a5876..91306f7011 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -2184,7 +2184,7 @@ private:
               [&](const auto &) {}},
           dir->u);
     }
-     mlir::LLVM::LoopAnnotationAttr la = mlir::LLVM::LoopAnnotationAttr::get(
+    mlir::LLVM::LoopAnnotationAttr la = mlir::LLVM::LoopAnnotationAttr::get(
         builder->getContext(), {}, /*vectorize=*/va, {}, /*unroll*/ ua, {}, {},
         {}, {}, {}, {}, {}, {}, {}, {}, {});
     if (has_attrs)
@@ -2287,7 +2287,7 @@ private:
         if (info.hasLocalitySpecs())
           handleLocalitySpecs(info);
 
-	addLoopAnnotationAttr(info, dirs);
+        addLoopAnnotationAttr(info, dirs);
         continue;
       }
 
diff --git a/flang/lib/Semantics/canonicalize-directives.cpp b/flang/lib/Semantics/canonicalize-directives.cpp
index d521ab3fdb..b27a276188 100644
--- a/flang/lib/Semantics/canonicalize-directives.cpp
+++ b/flang/lib/Semantics/canonicalize-directives.cpp
@@ -55,7 +55,7 @@ bool CanonicalizeDirectives(
 
 static bool IsExecutionDirective(const parser::CompilerDirective &dir) {
   return std::holds_alternative<parser::CompilerDirective::VectorAlways>(
-	     dir.u) ||
+             dir.u) ||
       std::holds_alternative<parser::CompilerDirective::Unroll>(dir.u);
 }
 
diff --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index ebcc29570d..705a6e0df0 100644
--- a/flang/lib/Semantics/resolve-names.cpp
+++ b/flang/lib/Semantics/resolve-names.cpp
@@ -9245,7 +9245,7 @@ void ResolveNamesVisitor::Post(const parser::AssignedGotoStmt &x) {
 }
 
 void ResolveNamesVisitor::Post(const parser::CompilerDirective &x) {
-  if (std::holds_alternative<parser::CompilerDirective::VectorAlways>(x.u) || 
+  if (std::holds_alternative<parser::CompilerDirective::VectorAlways>(x.u) ||
       std::holds_alternative<parser::CompilerDirective::Unroll>(x.u)) {
     return;
   }

``````````

</details>


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


More information about the flang-commits mailing list