[PATCH] D12418: Distribute the weight on the edge from switch to default statement to edges generated in lowering switch.

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 31 11:46:16 PDT 2015


hans accepted this revision.
hans added a subscriber: test.
hans added a comment.
This revision is now accepted and ready to land.

LGTM!


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8100
@@ +8099,3 @@
+        }
+
+        // If we're in the right place, emit the bit test header right now.
----------------
I see. I think your update made it easier to follow though, and it's nice that it matches the similar code further up.

================
Comment at: test/CodeGen/X86/switch-edge-weight.ll:41
@@ +40,3 @@
+; BB#4 to BB#1: [155, 159] (50)
+; BB#4 to BB#5: [0, 1133] - [155, 159] (15 = 10 + 5)
+; CHECK: Successors according to CFG: BB#1(50) BB#7(15)
----------------
Very nice, thanks!

================
Comment at: test/CodeGen/X86/switch-edge-weight.ll:60
@@ +59,3 @@
+
+; This switch statement will be translated into range checks.
+
----------------
The switch has four clusters though, so it becomes a binary tree with range checks in the leafs, just like @test above. Is this one testing something that @test doesn't?

================
Comment at: test/CodeGen/X86/switch-edge-weight.ll:115
@@ +114,3 @@
+; In this switch statement, there is an edge from jump table to default
+; statement.
+
----------------
s/statement/basic block/


http://reviews.llvm.org/D12418





More information about the llvm-commits mailing list