[PATCH] D80863: [WebAssembly] Eliminate range checks on br_tables

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 07:28:20 PDT 2020


aheejin added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyFixBrTableDefaults.cpp:59
+    // Install the default target and remove the jumps in the header.
+    auto *DefaultMBB = JumpMII->getOperand(0).getMBB();
+    MI.addOperand(MF, MachineOperand::CreateMBB(DefaultMBB));
----------------
aheejin wrote:
> Is this guaranteed that `br_table` BB is always a fallthrough, so the operand 0 is the default target? Can they be swapped?
If it is somehow guaranteed, it is fine, but if we are unsure, we can compare `br_if`'s argument to `MBB` to figure it out.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80863





More information about the llvm-commits mailing list