[PATCH] D22630: Loop rotation

Aditya Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 11:35:33 PST 2016


hiraditya added inline comments.


================
Comment at: llvm/test/Analysis/GlobalsModRef/memset-escape.ll:9-21
+; Check that load and the call to abort is redundant.
+; CHECK:   store i32 1, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @a, i64 0, i64 2), align 4
+; CHECK:   store i32 0, i32* @b, align 4
+; CHECK:   br label %for.body
 
-; CHECK-LABEL: @main
-; CHECK: call void @llvm.memset.p0i8.i64{{.*}} @a
-; CHECK: store i32 3
-; CHECK: load i32, i32* getelementptr {{.*}} @a
-; CHECK: icmp eq i32
-; CHECK: br i1
+; CHECK: for.body:                                         ; preds = %for.body.preheader
+; CHECK:   store i32 0, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @a, i64 0, i64 0), align 4
----------------
mzolotukhin wrote:
> Can you please explain why this test was changed?
The loop rotation causes the loop to be unrolled completely as a result the call to @abort is eliminated.

> Quoted Text




================
Comment at: llvm/test/Transforms/LoopRotate/alloca.ll:8-10
+; CHECK: alloca i8
+; CHECK: call void @use
+; CHECK: alloca i8
----------------
mzolotukhin wrote:
> Do we really need this change?
I can remove the change.


================
Comment at: llvm/test/Transforms/LoopRotate/preserve-loop-simplify.ll:19
 ; CHECK: [[INNER_PREROTATE_PREHEADER]]:
-; CHECK-NEXT: br i1 {{[^,]*}}, label %[[INNER_PREROTATE_PREHEADER_SPLIT_RETURN:[^,]*]], label %[[INNER_ROTATED_PREHEADER:[^,]*]]
+; CHECK: br label %inner.header.lr
+
----------------
mzolotukhin wrote:
> Why did this test change? Shouldn't we be producing the same results on such cases?
Thanks for pointing this out. I have added code to restore the loop-simplify form.


================
Comment at: llvm/test/Transforms/LoopRotate/simplifylatch.ll:47
+;CHECK-LABEL: @foo(
+;CHECK: for.body.lr:
+;CHECK: %arrayidx.lr = getelementptr inbounds i8, i8* %CurPtr, i64 %idxprom.lr
----------------
mzolotukhin wrote:
> Does rotated loop has a preheader now? If not, we're breaking LoopSimplify form, which is not good.
Yes the rotated loop has a preheader.


https://reviews.llvm.org/D22630





More information about the llvm-commits mailing list