[PATCH] D15546: [WebAssembly] Print an extra local decl when the user stack pointer is used

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 16:28:06 PST 2015


sunfish added inline comments.

================
Comment at: lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp:185
@@ -183,1 +184,3 @@
   }
+  if (MF->getFrameInfo()->getStackSize() > 0) {
+    // TODO: wasm64
----------------
This works, but it's a little odd that the WebAssemblyFunctionInfo has PhysRegs as a general-purpose thing, but we have a special case for SP here. Would be be feasible to iterate over PhysRegs here instead?

================
Comment at: test/CodeGen/WebAssembly/userstack.ll:10
@@ -9,1 +9,3 @@
+; Check that there is an extra local for the stack pointer.
+; CHECK: .local i32, i32, i32, i32
 define void @alloca32() {
----------------
jfb wrote:
> Terminate with `{{$}}` here and below.
These CHECK lines would be good candidates for {{$}} at the end, to ensure that we have exactly the right number of locals.


http://reviews.llvm.org/D15546





More information about the llvm-commits mailing list