[PATCH] D12166: Assign weights to edges to jump table when lowering switch statement.

Cong Hou via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 15:25:27 PDT 2015


congh added a comment.

In http://reviews.llvm.org/D12166#229003, @davidxl wrote:

> Can we add more unit test cases (with annotated profile data) to cover profile update for various switch lowering strategies?


OK. I will investigate on switch lowering and try to make a test case covering all cases with profile data check.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:1901
@@ -1900,3 +1900,3 @@
   addSuccessorWithWeight(SwitchBB, B.Default);
   addSuccessorWithWeight(SwitchBB, MBB);
 
----------------
davidxl wrote:
> Same bug occurs here too. The weight to MBB should be the sum of the ExtraWeight of all cases of 'B'.   See visitBitTestCase.
You are right. I will also fix this issue in this patch.


http://reviews.llvm.org/D12166





More information about the llvm-commits mailing list