-
Notifications
You must be signed in to change notification settings - Fork 341
🍒 [WebAssembly] Define local sp if llvm.stacksave
is used
#7563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🍒 [WebAssembly] Define local sp if llvm.stacksave
is used
#7563
Conversation
@swift-ci Please test |
f5e7561
to
6c4bb7a
Compare
@swift-ci Please test |
llvm.stacksave
is usedllvm.stacksave
is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comparing the cherry-pick to the original commit, this looks clean to me 👍
Should this target a different branch though? stable/20221013 is quite old, I'm not sure if it corresponds to the current Swift branch |
Usually `llvm.stacksave/stackrestore` are used together with `alloca` but they can appear without it (e.g. `alloca` can be optimized away). WebAssembly's function local physical user sp register, which is referenced by `llvm.stacksave` is created while frame lowering and replaced with virtual register. However the sp register was not created when `llvm.stacksave` is used without `alloca`, and it led MIR verification failure about use-before-def of sp virtual register. Resolves llvm#62235
6c4bb7a
to
44efb09
Compare
@swift-ci Please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@swift-ci Please test |
Cherry-pick: da0ca5d
Resolves: rdar://116374985
Usually
llvm.stacksave/stackrestore
are used together withalloca
but they can appear without it (e.g.alloca
can be optimized away). WebAssembly's function local physical user sp register, which is referenced byllvm.stacksave
is created while frame lowering and replaced with virtual register. However the sp register was not created whenllvm.stacksave
is used withoutalloca
, and it led MIR verification failure about use-before-def of sp virtual register.