[PATCH] D22630: Loop rotation

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 13:07:35 PST 2017


hiraditya added inline comments.


================
Comment at: llvm/test/Transforms/LoopRotate/loop-rotate.ll:210
+
+; Check that the loop with pre-header and loop-body having a switch block is rotated.
+; CHECK-LABEL: @bar5
----------------
mzolotukhin wrote:
> Will the following routine test the same?
> ```
> define i32 @bar5() {
> 
> entry:
>   br label %loop.header
> 
> loop.header:
>   %a = phi i32 [ %b, %latch ], [ 0, %entry ]
>   switch i8 undef, label %loop.body [
>     i8 0, label %unreach
>     i8 1, label %unreach
>   ]
> 
> loop.body:
>   br i1 undef, label %latch, label %return
> 
> latch:
>   %b = phi i32 [ %a, %loop.body ]
>   br label %loop.header
> 
> unreach:
>   unreachable
> 
> return:
>   ret i32 0
> }
> ```
> If it's sufficient, can you minimize other test in the similar manner? It should be much easier to understand what's going on, and hopefully they'll be much less fragile.
I have minimized other tests as well.


================
Comment at: llvm/test/Transforms/LoopRotate/nosimplifylatch.ll:6-7
 ;CHECK: for.inc:
-;CHECK-NEXT: %incdec.ptr.i = getelementptr 
+;CHECK: %incdec.ptr.i = getelementptr
+;CHECK: br
 
----------------
mzolotukhin wrote:
> mzolotukhin wrote:
> > Why do we need this change?
> The question is still relevant.
After for-in there is a phi now


https://reviews.llvm.org/D22630





More information about the llvm-commits mailing list