[PATCH] D63972: [CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 20:11:28 PDT 2019


skatkov added a comment.

Please provide a quick fix or revert the patch causing the crash due to transforming to incorrect IR.



================
Comment at: llvm/trunk/lib/CodeGen/MachineBlockPlacement.cpp:2794
+               PE = TBB->pred_end(); PI != PE; PI++)
+            (*PI)->ReplaceUsesOfBlockWith(TBB, ChainBB);
+
----------------
This patches causes a crash because it does not take into account jump tables.

If TBB is a target of jump table you eliminate the machine basic block and jump table points to dead block now resulting in bad IR.

I guess that it was expected that ReplaceUsesOfBlockWith will do all things to replace usage of TBB but I see that it does not deal with jump tables.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D63972





More information about the llvm-commits mailing list