[llvm] [WebAssembly] Define local sp if `llvm.stacksave` is used (PR #68133)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 10:44:57 PDT 2023


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 dd76375c80098be4d08b7e02290e39a8c1d00ab1 b5043f535ac5c8d80f36665c2296192edb26de1d -- llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
index d26234e7e71d..28d4a9ff3cb9 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp
@@ -150,9 +150,9 @@ bool WebAssemblyFrameLowering::needsSP(const MachineFunction &MF) const {
   auto &MRI = MF.getRegInfo();
   // llvm.stacksave can explicitly read SP register and it can appear without
   // dynamic alloca.
-  bool hasExplicitSPUse = any_of(MRI.use_operands(getSPReg(MF)), [](MachineOperand &MO) {
-    return !MO.isImplicit();
-  });
+  bool hasExplicitSPUse =
+      any_of(MRI.use_operands(getSPReg(MF)),
+             [](MachineOperand &MO) { return !MO.isImplicit(); });
 
   return needsSPForLocalFrame(MF) || needsPrologForEH(MF) || hasExplicitSPUse;
 }

``````````

</details>


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


More information about the llvm-commits mailing list