[PATCH] D137824: [WebAssembly] multivalue stackify fix

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 09:32:51 PST 2022


tlively added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp:339-340
   // current def in the stack, which cannot be achieved, even with locals.
+  // If any subsequent def is used prior by a different instruction, we also
+  // cannot stackify.
   for (const auto &SubsequentDef : drop_begin(DefI->defs())) {
----------------
This doesn't sound quite right. As a counterexample, consider

```
a, b = foo
bar a
baz b
```

Here we have a subsequent def (of `b`) used by a different instruction (`baz`), but we can still stackify by moving `baz` before `bar`.

It would be good to reduce the test case to figure out more precisely what the problem is and come up with a more precise solution. Maybe the problem is that `baz` and `bar` (or rather their equivalents in the test) cannot be reordered?


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

https://reviews.llvm.org/D137824



More information about the llvm-commits mailing list