[PATCH] D140975: Support critical edge splitting for jump tables

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 17:41:15 PDT 2023


MatzeB added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineBasicBlock.cpp:1063
+    MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
+    MJTI->ReplaceMBBInJumpTable(JTI, Succ, NMBB);
+  }
----------------
efriedma wrote:
> Have we proven at this point that this jump is the only use of the jump table in question?  With optimizations like tail duplication, you could have multiple basic blocks referencing the same table.
Good point!

As far as I can tell this case is somewhat rare as most switch-jumps are preceded by a range check which is not profitable for tail-duplication. Given that I decided to just detect and not performing the edge splitting in case of multiple users.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140975



More information about the llvm-commits mailing list