[PATCH] D81909: [WebAssembly] Fix bug in FixBrTables and use branch analysis utils

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 17 14:35:08 PDT 2020


tlively marked an inline comment as done.
tlively added inline comments.


================
Comment at: llvm/test/CodeGen/WebAssembly/switch-unreachable-default.ll:65
+    i8 49, label %sw.bb5
+  ]
+
----------------
aheejin wrote:
> Unrelated question: why does this switch get split? Because it’s too big? If so, big br_tables are also bad for wasm too? 
Right, it's because the case indices are clustered into different groups that are far away from each other. The target-independent codegen has a lot of logic for figuring out how to best split up and group the switch cases to create only reasonably-dense jump tables. This is good for uncompressed WebAssembly as well, although a sparse br_table would still compress well. I don't know if any engines do clever lowerings of br_tables, but we want to make naively lowering them into native jump tables a reasonable option as well, so it is good to have this logic in the tools.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81909





More information about the llvm-commits mailing list