[PATCH] D51320: [WebAssembly] Made disassembler only use stack instructions.

Wouter van Oortmerssen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 27 15:31:26 PDT 2018


aardappel added inline comments.


================
Comment at: utils/TableGen/WebAssemblyDisassemblerEmitter.cpp:94
+        for (size_t J = 0; J < OperandTable.size(); ++J) {
+          if (J + CurOperandList.size() <= OperandTable.size()) {
+            for (size_t K = 0; K < CurOperandList.size(); ++K) {
----------------
jgravelle-google wrote:
> Could flip these:
> ```
>   if (CurOperandList.size() < OperandTable.size()) {
>     for (size_t J = 0; J < OperandTable.size() - CurOperandList.size(); ++J) {
> ```
> which is iotally more efficient. Probably more readable the way you have it though. Was thinking we could omit the `if` entirely, but size isn't signed.
`<=`, but yes, that's better :)


Repository:
  rL LLVM

https://reviews.llvm.org/D51320





More information about the llvm-commits mailing list