Details
Diff Detail
Event Timeline
lgtm after updating the test.
test/CodeGen/WebAssembly/userstack.ll | ||
---|---|---|
10 | Terminate with {{$}} here and below. |
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp | ||
---|---|---|
187 | 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? | |
test/CodeGen/WebAssembly/userstack.ll | ||
10 | These CHECK lines would be good candidates for {{$}} at the end, to ensure that we have exactly the right number of locals. |
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp | ||
---|---|---|
187 | well, IIUC it would be "iterate over phys regs except for ARGUMENTS and EXPR_STACK" which would leave us with SP and FP. so approximately the same level of weirdness either way? |
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp | ||
---|---|---|
187 | I mean iterate over MFI->PhysRegs and only look at elements that are not -1U. That way if we implement MFI->adjustsStack() or hasFP(MF) or whatever in WebAssemblyFrameInfo.cpp, we won't need to update this code too. I think you can extend WebAssemblyAsmPrinter::getRegType to know about physregs using TRI->getMinimalPhysRegClass. |
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?