[llvm] [WebAssembly] Define local sp if `llvm.stacksave` is used (PR #68133)
Yuta Saito via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 3 11:50:05 PDT 2023
================
@@ -147,7 +147,14 @@ bool WebAssemblyFrameLowering::needsPrologForEH(
/// Unlike a machine stack pointer, the wasm user stack pointer is a global
/// variable, so it is loaded into a register in the prolog.
bool WebAssemblyFrameLowering::needsSP(const MachineFunction &MF) const {
- return needsSPForLocalFrame(MF) || needsPrologForEH(MF);
+ auto &MRI = MF.getRegInfo();
+ // llvm.stacksave can explicitly read SP register and it can appear without
+ // dynamic alloca.
+ bool hasExplicitSPUse =
----------------
kateinoigakukun wrote:
That sounds reasonable to me :+1: Updated.
https://github.com/llvm/llvm-project/pull/68133
More information about the llvm-commits
mailing list