[flang-commits] [flang] [Flang] - Add optional inlining of allocatable assignments with hlfir.expr RHS (PR #186880)
via flang-commits
flang-commits at lists.llvm.org
Mon Mar 16 13:50:30 PDT 2026
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 origin/main HEAD --extensions cpp -- flang/lib/Optimizer/HLFIR/Transforms/InlineHLFIRAssign.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/InlineHLFIRAssign.cpp b/flang/lib/Optimizer/HLFIR/Transforms/InlineHLFIRAssign.cpp
index db9826257..212bb683d 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/InlineHLFIRAssign.cpp
+++ b/flang/lib/Optimizer/HLFIR/Transforms/InlineHLFIRAssign.cpp
@@ -258,9 +258,8 @@ public:
fir::factory::getExtents(loc, builder, storage);
// Generate loop nest to assign elements
- hlfir::LoopNest loopNest =
- hlfir::genLoopNest(loc, builder, extents, /*isUnordered=*/true,
- useWorkshare);
+ hlfir::LoopNest loopNest = hlfir::genLoopNest(
+ loc, builder, extents, /*isUnordered=*/true, useWorkshare);
builder.setInsertionPointToStart(loopNest.body);
// Get RHS element via hlfir.apply
@@ -269,8 +268,8 @@ public:
rhsElement = hlfir::loadTrivialScalar(loc, builder, rhsElement);
// Get LHS element
- hlfir::Entity lhsElement =
- hlfir::getElementAt(loc, builder, lhsEntity, loopNest.oneBasedIndices);
+ hlfir::Entity lhsElement = hlfir::getElementAt(loc, builder, lhsEntity,
+ loopNest.oneBasedIndices);
// Assign the element (scalar, non-allocatable)
hlfir::AssignOp::create(builder, loc, rhsElement, lhsElement,
``````````
</details>
https://github.com/llvm/llvm-project/pull/186880
More information about the flang-commits
mailing list