[llvm] [AArch64] Fix register reversing crash on MSVC with 1 pair. (PR #82392)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 09:57:05 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 d2942a86d7b8fc4cba4f73294efb53a3e47dc751 528a30454f8d2e25b44ee3641ed5c70d13b0b9ba -- llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
index 6c8117cb97..e6464f024d 100644
--- a/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
@@ -3116,11 +3116,15 @@ bool AArch64FrameLowering::restoreCalleeSavedRegisters(
 
   // For performance reasons restore SVE register in increasing order
   if (RegPairs.size() > 1) {
-    auto IsPPR = [](const RegPairInfo &c) { return c.Type == RegPairInfo::PPR; };
+    auto IsPPR = [](const RegPairInfo &c) {
+      return c.Type == RegPairInfo::PPR;
+    };
     auto PPRBegin = std::find_if(RegPairs.begin(), RegPairs.end(), IsPPR);
     auto PPREnd = std::find_if(RegPairs.rbegin(), RegPairs.rend(), IsPPR);
     std::reverse(PPRBegin, PPREnd.base());
-    auto IsZPR = [](const RegPairInfo &c) { return c.Type == RegPairInfo::ZPR; };
+    auto IsZPR = [](const RegPairInfo &c) {
+      return c.Type == RegPairInfo::ZPR;
+    };
     auto ZPRBegin = std::find_if(RegPairs.begin(), RegPairs.end(), IsZPR);
     auto ZPREnd = std::find_if(RegPairs.rbegin(), RegPairs.rend(), IsZPR);
     std::reverse(ZPRBegin, ZPREnd.base());

``````````

</details>


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


More information about the llvm-commits mailing list