[PATCH] D22778: Add Loop Sink pass to reverse the LICM based of basic block frequency.

David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 13:26:27 PDT 2016


davidxl added inline comments.

================
Comment at: test/Transforms/LICM/loopsink.ll:17
@@ +16,3 @@
+;    \  /
+;     b6
+; preheader: 1000
----------------
b6 --> b7

================
Comment at: test/Transforms/LICM/loopsink.ll:23
@@ +22,3 @@
+; Sink load to b2
+; CHECK: t1
+; CHECK: .b2:
----------------
add check-not of @g after preheader.

================
Comment at: test/Transforms/LICM/loopsink.ll:26
@@ +25,3 @@
+; CHECK: load i32, i32* @g
+; CHECK: .b3:
+define i32 @t1(i32, i32) #0 {
----------------
add check-not @g after b3 and b4

================
Comment at: test/Transforms/LICM/loopsink.ll:65
@@ +64,3 @@
+  %c7 = icmp eq i32 %t7, %p7
+  br i1 %c7, label %.exit, label %.b1
+
----------------
Add a branch profile data here.

================
Comment at: test/Transforms/LICM/loopsink.ll:74
@@ +73,3 @@
+;    /  \
+;   b2  B6
+;  /  \  |
----------------
B6 --> b6

================
Comment at: test/Transforms/LICM/loopsink.ll:76
@@ +75,3 @@
+;  /  \  |
+; B3  b4 |
+;  \  /  |
----------------
B3 --> b3

================
Comment at: test/Transforms/LICM/loopsink.ll:80
@@ +79,3 @@
+;    \  /
+;     b6
+; preheader: 500
----------------
This should be b7

================
Comment at: test/Transforms/LICM/loopsink.ll:131
@@ +130,3 @@
+  %c7 = icmp eq i32 %t7, %p7
+  br i1 %c7, label %.exit, label %.b1
+
----------------
annotate with branch profile data

================
Comment at: test/Transforms/LICM/loopsink.ll:142
@@ +141,3 @@
+;  /  \  |
+; B3  b4 |
+;  \  /  |
----------------
B3 -> b3

================
Comment at: test/Transforms/LICM/loopsink.ll:146
@@ +145,3 @@
+;    \  /
+;     b6
+; preheader: 500
----------------
b6 -> b7

================
Comment at: test/Transforms/LICM/loopsink.ll:210
@@ +209,3 @@
+
+.b1:
+  %iv = phi i32 [ %t1, %.b1 ], [ 0, %.preheader ]
----------------
but this loop will be executed at least once per call of t4, so the loop body frequency should not be lower than entry frequency

================
Comment at: test/Transforms/LICM/loopsink.ll:271
@@ +270,3 @@
+  %t6 = add nsw i32 %iv, 100
+  store i32 %t6, i32* %1, align 4
+  br label %.b7
----------------
This test can be simplified a little by just making an external call here.


https://reviews.llvm.org/D22778





More information about the llvm-commits mailing list