[llvm] [ArgPromotion] Handle pointer arguments of recursive calls (PR #78735)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 07:55:47 PST 2024


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 97747467f1320b6e80495c5961a0176e0738863b 013ead721a7f076a305bd3a2d08f2eecde573b9a -- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index 072a8c46f1..3891afbe01 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -616,7 +616,8 @@ static bool findArgParts(Argument *Arg, const DataLayout &DL, AAResults &AAR,
       Value *Ptr = CI->getArgOperand(U->getOperandNo());
       Align PtrAlign = Ptr->getPointerAlignment(DL);
       APInt Offset(DL.getIndexTypeSizeInBits(Ptr->getType()), 0);
-      Ptr = Ptr->stripAndAccumulateConstantOffsets(DL, Offset, /* AllowNonInbounds */ true);
+      Ptr = Ptr->stripAndAccumulateConstantOffsets(DL, Offset,
+                                                   /* AllowNonInbounds */ true);
       if (Ptr != Arg)
         return false;
 
@@ -629,12 +630,11 @@ static bool findArgParts(Argument *Arg, const DataLayout &DL, AAResults &AAR,
         return false;
 
       int64_t Off = Offset.getSExtValue();
-      auto Pair = ArgParts.try_emplace(
-          Off, ArgPart{Ty, PtrAlign, nullptr});
+      auto Pair = ArgParts.try_emplace(Off, ArgPart{Ty, PtrAlign, nullptr});
       ArgPart &Part = Pair.first->second;
 
-      // We limit promotion to only promoting up to a fixed number of elements of
-      // the aggregate.
+      // We limit promotion to only promoting up to a fixed number of elements
+      // of the aggregate.
       if (MaxElements > 0 && ArgParts.size() > MaxElements) {
         LLVM_DEBUG(dbgs() << "ArgPromotion of " << *Arg << " failed: "
                           << "more than " << MaxElements << " parts\n");

``````````

</details>


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


More information about the llvm-commits mailing list