[PATCH] D76784: [WebAssembly] Clear frame base vreg in explicit-locals when stack pointer is dead

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 25 16:49:19 PDT 2020


dschuff added a comment.

No I mean alloca as in the LLVM instruction. Just having an address-taken local in C is enough to cause an alloca in the IR.

And yeah you are right, I think it would still require the same ways to deal with it.
I think a possible alternative would be to go back to modeling SP as a physical register, and exempting it from the code that touches vregs. That would have some complications of its own (and probably result in slightly worse code in some cases), but may or may not be cleaner.

Even in this case the final output code has a prolog that calculates a value for SP but then immediately drops it because it's unused. This CL keeps it from crashing but clearly we should do better and either not emit or optimize away the prolog entirely.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76784/new/

https://reviews.llvm.org/D76784





More information about the llvm-commits mailing list