When we don't actually have stack-allocated variables but needs SP only
to support EH, we don't need to write SP back in the epilog, because we
don't bump down the stack pointer.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/WebAssembly/WebAssemblyEHRestoreStackPointer.cpp | ||
---|---|---|
73 ↗ | (On Diff #162006) | __stack_pointer |
75 ↗ | (On Diff #162006) | can't leaf functions have try/catch blocks, even if there are no calls? I think the real issue is that leaf functions do not to restore the stack pointer on catch, because it won't have been updated by any callees. |
lib/Target/WebAssembly/WebAssemblyFrameLowering.cpp | ||
115 ↗ | (On Diff #162006) | Another possible way: which would avoid so many nots... Actually, even better may be to turn NeedsSPForLocalFrame() into a function (that can be called by needsSP()). Then you can reuse it here instead of duplicating the logic? |
lib/Target/WebAssembly/WebAssemblyEHRestoreStackPointer.cpp | ||
---|---|---|
75 ↗ | (On Diff #162006) | Right, good point. |