[llvm] [Hexagon] Order objects on the stack by their alignments (PR #81280)

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 9 09:08:39 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 db88f3015867ca569ae78a30f20a944c8e1b8afc 3abb8d015faa8fddf292e1dcb25dc61204a39f04 -- llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp llvm/lib/Target/Hexagon/HexagonFrameLowering.h
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp b/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
index d55d8edb58..e6d8695f90 100644
--- a/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp
@@ -2693,9 +2693,9 @@ namespace {
 // Struct used by orderFrameObjects to help sort the stack objects.
 struct HexagonFrameSortingObject {
   bool IsValid = false;
-  unsigned Index = 0;     // Index of Object into MFI list.
+  unsigned Index = 0; // Index of Object into MFI list.
   unsigned Size = 0;
-  Align ObjectAlignment = Align(1);     // Alignment of Object in bytes.
+  Align ObjectAlignment = Align(1); // Alignment of Object in bytes.
 };
 
 struct HexagonFrameSortingComparator {
@@ -2710,7 +2710,7 @@ struct HexagonFrameSortingComparator {
 // Sort objects on the stack by alignment value and then by size to minimize
 // padding.
 void HexagonFrameLowering::orderFrameObjects(
-  const MachineFunction &MF, SmallVectorImpl<int> &ObjectsToAllocate) const {
+    const MachineFunction &MF, SmallVectorImpl<int> &ObjectsToAllocate) const {
   const MachineFrameInfo &MFI = MF.getFrameInfo();
   int NObjects = ObjectsToAllocate.size();
 
@@ -2718,9 +2718,11 @@ void HexagonFrameLowering::orderFrameObjects(
     return;
 
   // Create an array of all MFI objects.
-  std::vector<HexagonFrameSortingObject> SortingObjects(MFI.getObjectIndexEnd());
+  std::vector<HexagonFrameSortingObject> SortingObjects(
+      MFI.getObjectIndexEnd());
 
-  for (int i = 0, j = 0, e = MFI.getObjectIndexEnd(); i != e && j != NObjects; ++i) {
+  for (int i = 0, j = 0, e = MFI.getObjectIndexEnd(); i != e && j != NObjects;
+       ++i) {
     if (i != ObjectsToAllocate[j])
       continue;
     j++;

``````````

</details>


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


More information about the llvm-commits mailing list