[llvm] r277524 - [LoopUnroll] Switch the default value of -unroll-runtime-epilog back to its original value.

Bruno Cardoso Lopes via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 14:48:28 PDT 2016


Hi Michael,

Looks like this broke a test in
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/26846/

Can you take a look?

On Tue, Aug 2, 2016 at 2:24 PM, Michael Zolotukhin via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: mzolotukhin
> Date: Tue Aug  2 16:24:14 2016
> New Revision: 277524
>
> URL: http://llvm.org/viewvc/llvm-project?rev=277524&view=rev
> Log:
> [LoopUnroll] Switch the default value of -unroll-runtime-epilog back to its original value.
>
> As agreed in post-commit review of r265388, I'm switching the flag to
> its original value until the 90% runtime performance regression on
> SingleSource/Benchmarks/Stanford/Bubblesort is addressed.
>
> Modified:
>     llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
>     llvm/trunk/test/Transforms/LoopUnroll/AArch64/runtime-loop.ll
>     llvm/trunk/test/Transforms/LoopUnroll/runtime-loop.ll
>     llvm/trunk/test/Transforms/LoopUnroll/runtime-loop1.ll
>     llvm/trunk/test/Transforms/LoopUnroll/runtime-loop2.ll
>     llvm/trunk/test/Transforms/LoopUnroll/runtime-loop4.ll
>     llvm/trunk/test/Transforms/LoopUnroll/runtime-loop5.ll
>     llvm/trunk/test/Transforms/LoopUnroll/tripcount-overflow.ll
>     llvm/trunk/test/Transforms/LoopUnroll/unroll-cleanup.ll
>     llvm/trunk/test/Transforms/LoopUnroll/unroll-pragmas.ll
>
> Modified: llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp?rev=277524&r1=277523&r2=277524&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp (original)
> +++ llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp Tue Aug  2 16:24:14 2016
> @@ -46,7 +46,7 @@ STATISTIC(NumCompletelyUnrolled, "Number
>  STATISTIC(NumUnrolled, "Number of loops unrolled (completely or otherwise)");
>
>  static cl::opt<bool>
> -UnrollRuntimeEpilog("unroll-runtime-epilog", cl::init(true), cl::Hidden,
> +UnrollRuntimeEpilog("unroll-runtime-epilog", cl::init(false), cl::Hidden,
>                      cl::desc("Allow runtime unrolled loops to be unrolled "
>                               "with epilog instead of prolog."));
>
>
> Modified: llvm/trunk/test/Transforms/LoopUnroll/AArch64/runtime-loop.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/AArch64/runtime-loop.ll?rev=277524&r1=277523&r2=277524&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/LoopUnroll/AArch64/runtime-loop.ll (original)
> +++ llvm/trunk/test/Transforms/LoopUnroll/AArch64/runtime-loop.ll Tue Aug  2 16:24:14 2016
> @@ -1,4 +1,4 @@
> -; RUN: opt < %s -S -loop-unroll -mtriple aarch64 -mcpu=cortex-a57 | FileCheck %s -check-prefix=EPILOG
> +; RUN: opt < %s -S -loop-unroll -mtriple aarch64 -mcpu=cortex-a57 -unroll-runtime-epilog=true  | FileCheck %s -check-prefix=EPILOG
>  ; RUN: opt < %s -S -loop-unroll -mtriple aarch64 -mcpu=cortex-a57 -unroll-runtime-epilog=false | FileCheck %s -check-prefix=PROLOG
>
>  ; Tests for unrolling loops with run-time trip counts
>
> Modified: llvm/trunk/test/Transforms/LoopUnroll/runtime-loop.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/runtime-loop.ll?rev=277524&r1=277523&r2=277524&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/LoopUnroll/runtime-loop.ll (original)
> +++ llvm/trunk/test/Transforms/LoopUnroll/runtime-loop.ll Tue Aug  2 16:24:14 2016
> @@ -1,4 +1,4 @@
> -; RUN: opt < %s -S -loop-unroll -unroll-runtime=true | FileCheck %s -check-prefix=EPILOG
> +; RUN: opt < %s -S -loop-unroll -unroll-runtime=true -unroll-runtime-epilog=true  | FileCheck %s -check-prefix=EPILOG
>  ; RUN: opt < %s -S -loop-unroll -unroll-runtime=true -unroll-runtime-epilog=false | FileCheck %s -check-prefix=PROLOG
>
>  target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
>
> Modified: llvm/trunk/test/Transforms/LoopUnroll/runtime-loop1.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/runtime-loop1.ll?rev=277524&r1=277523&r2=277524&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/LoopUnroll/runtime-loop1.ll (original)
> +++ llvm/trunk/test/Transforms/LoopUnroll/runtime-loop1.ll Tue Aug  2 16:24:14 2016
> @@ -1,4 +1,4 @@
> -; RUN: opt < %s -S -loop-unroll -unroll-runtime -unroll-count=2 | FileCheck %s -check-prefix=EPILOG
> +; RUN: opt < %s -S -loop-unroll -unroll-runtime -unroll-count=2 -unroll-runtime-epilog=true | FileCheck %s -check-prefix=EPILOG
>  ; RUN: opt < %s -S -loop-unroll -unroll-runtime -unroll-count=2 -unroll-runtime-epilog=false | FileCheck %s -check-prefix=PROLOG
>
>  ; This tests that setting the unroll count works
>
> Modified: llvm/trunk/test/Transforms/LoopUnroll/runtime-loop2.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/runtime-loop2.ll?rev=277524&r1=277523&r2=277524&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/LoopUnroll/runtime-loop2.ll (original)
> +++ llvm/trunk/test/Transforms/LoopUnroll/runtime-loop2.ll Tue Aug  2 16:24:14 2016
> @@ -1,4 +1,4 @@
> -; RUN: opt < %s -S -loop-unroll -unroll-threshold=25 -unroll-runtime -unroll-count=8 | FileCheck %s  -check-prefix=EPILOG
> +; RUN: opt < %s -S -loop-unroll -unroll-threshold=25 -unroll-runtime -unroll-runtime-epilog=true  -unroll-count=8 | FileCheck %s  -check-prefix=EPILOG
>  ; RUN: opt < %s -S -loop-unroll -unroll-threshold=25 -unroll-runtime -unroll-runtime-epilog=false | FileCheck %s -check-prefix=PROLOG
>
>  ; Choose a smaller, power-of-two, unroll count if the loop is too large.
>
> Modified: llvm/trunk/test/Transforms/LoopUnroll/runtime-loop4.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/runtime-loop4.ll?rev=277524&r1=277523&r2=277524&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/LoopUnroll/runtime-loop4.ll (original)
> +++ llvm/trunk/test/Transforms/LoopUnroll/runtime-loop4.ll Tue Aug  2 16:24:14 2016
> @@ -1,4 +1,4 @@
> -; RUN: opt < %s -S -O2 -unroll-runtime=true | FileCheck %s -check-prefix=EPILOG
> +; RUN: opt < %s -S -O2 -unroll-runtime=true -unroll-runtime-epilog=true  | FileCheck %s -check-prefix=EPILOG
>  ; RUN: opt < %s -S -O2 -unroll-runtime=true -unroll-runtime-epilog=false | FileCheck %s -check-prefix=PROLOG
>
>  ; Check runtime unrolling prologue can be promoted by LICM pass.
>
> Modified: llvm/trunk/test/Transforms/LoopUnroll/runtime-loop5.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/runtime-loop5.ll?rev=277524&r1=277523&r2=277524&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/LoopUnroll/runtime-loop5.ll (original)
> +++ llvm/trunk/test/Transforms/LoopUnroll/runtime-loop5.ll Tue Aug  2 16:24:14 2016
> @@ -11,6 +11,9 @@ entry:
>    %cmp1 = icmp eq i3 %n, 0
>    br i1 %cmp1, label %for.end, label %for.body
>
> +; UNROLL-16-NOT: for.body.prol:
> +; UNROLL-4: for.body.prol:
> +
>  for.body:                                         ; preds = %for.body, %entry
>  ; UNROLL-16-LABEL: for.body:
>  ; UNROLL-4-LABEL: for.body:
> @@ -36,10 +39,6 @@ for.body:
>
>  ; UNROLL-16-LABEL: for.end
>  ; UNROLL-4-LABEL: for.end
> -
> -; UNROLL-16-NOT: for.body.epil:
> -; UNROLL-4: for.body.epil:
> -
>  for.end:                                          ; preds = %for.body, %entry
>    %sum.0.lcssa = phi i3 [ 0, %entry ], [ %add, %for.body ]
>    ret i3 %sum.0.lcssa
>
> Modified: llvm/trunk/test/Transforms/LoopUnroll/tripcount-overflow.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/tripcount-overflow.ll?rev=277524&r1=277523&r2=277524&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/LoopUnroll/tripcount-overflow.ll (original)
> +++ llvm/trunk/test/Transforms/LoopUnroll/tripcount-overflow.ll Tue Aug  2 16:24:14 2016
> @@ -1,4 +1,4 @@
> -; RUN: opt < %s -S -unroll-runtime -unroll-count=2 -loop-unroll | FileCheck %s -check-prefix=EPILOG
> +; RUN: opt < %s -S -unroll-runtime -unroll-count=2 -loop-unroll -unroll-runtime-epilog=true  | FileCheck %s -check-prefix=EPILOG
>  ; RUN: opt < %s -S -unroll-runtime -unroll-count=2 -loop-unroll -unroll-runtime-epilog=false | FileCheck %s -check-prefix=PROLOG
>  target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
>
>
> Modified: llvm/trunk/test/Transforms/LoopUnroll/unroll-cleanup.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/unroll-cleanup.ll?rev=277524&r1=277523&r2=277524&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/LoopUnroll/unroll-cleanup.ll (original)
> +++ llvm/trunk/test/Transforms/LoopUnroll/unroll-cleanup.ll Tue Aug  2 16:24:14 2016
> @@ -4,14 +4,14 @@
>  ; RUN: opt < %s -O2 -S | FileCheck %s
>
>  ; After loop unroll:
> -;       %niter.nsub = add nsw i32 %niter, -1
> +;       %dec18 = add nsw i32 %dec18.in, -1
>  ;       ...
> -;       %niter.nsub.1 = add nsw i32 %niter.nsub, -1
> +;       %dec18.1 = add nsw i32 %dec18, -1
>  ; should be merged to:
> -;       %dec18.1 = add nsw i32 %niter, -2
> +;       %dec18.1 = add nsw i32 %dec18.in, -2
>  ;
>  ; CHECK-LABEL: @_Z3fn1v(
> -; CHECK: %niter.nsub.1 = add i32 %niter, -2
> +; CHECK: %dec18.1 = add nsw i32 %dec18.in, -2
>
>  ; ModuleID = '<stdin>'
>  target triple = "x86_64-unknown-linux-gnu"
>
> Modified: llvm/trunk/test/Transforms/LoopUnroll/unroll-pragmas.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopUnroll/unroll-pragmas.ll?rev=277524&r1=277523&r2=277524&view=diff
> ==============================================================================
> --- llvm/trunk/test/Transforms/LoopUnroll/unroll-pragmas.ll (original)
> +++ llvm/trunk/test/Transforms/LoopUnroll/unroll-pragmas.ll Tue Aug  2 16:24:14 2016
> @@ -108,29 +108,6 @@ for.end:
>  !3 = !{!3, !4}
>  !4 = !{!"llvm.loop.unroll.full"}
>
> -; #pragma clang loop unroll(full)
> -; Loop should be fully unrolled, even for optsize.
> -;
> -; CHECK-LABEL: @loop64_with_full_optsize(
> -; CHECK-NOT: br i1
> -define void @loop64_with_full_optsize(i32* nocapture %a) optsize {
> -entry:
> -  br label %for.body
> -
> -for.body:                                         ; preds = %for.body, %entry
> -  %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
> -  %arrayidx = getelementptr inbounds i32, i32* %a, i64 %indvars.iv
> -  %0 = load i32, i32* %arrayidx, align 4
> -  %inc = add nsw i32 %0, 1
> -  store i32 %inc, i32* %arrayidx, align 4
> -  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
> -  %exitcond = icmp eq i64 %indvars.iv.next, 64
> -  br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !3
> -
> -for.end:                                          ; preds = %for.body
> -  ret void
> -}
> -
>  ; #pragma clang loop unroll_count(4)
>  ; Loop should be unrolled 4 times.
>  ;
> @@ -194,6 +171,10 @@ for.end:
>  ; should be duplicated (original and 4x unrolled).
>  ;
>  ; CHECK-LABEL: @runtime_loop_with_count4(
> +; CHECK: for.body.prol:
> +; CHECK: store
> +; CHECK-NOT: store
> +; CHECK: br i1
>  ; CHECK: for.body
>  ; CHECK: store
>  ; CHECK: store
> @@ -201,10 +182,6 @@ for.end:
>  ; CHECK: store
>  ; CHECK-NOT: store
>  ; CHECK: br i1
> -; CHECK: for.body.epil:
> -; CHECK: store
> -; CHECK-NOT: store
> -; CHECK: br i1
>  define void @runtime_loop_with_count4(i32* nocapture %a, i32 %b) {
>  entry:
>    %cmp3 = icmp sgt i32 %b, 0
> @@ -310,6 +287,10 @@ for.end:
>  ; (original and 8x).
>  ;
>  ; CHECK-LABEL: @runtime_loop_with_enable(
> +; CHECK: for.body.prol:
> +; CHECK: store
> +; CHECK-NOT: store
> +; CHECK: br i1
>  ; CHECK: for.body:
>  ; CHECK: store i32
>  ; CHECK: store i32
> @@ -321,10 +302,6 @@ for.end:
>  ; CHECK: store i32
>  ; CHECK-NOT: store i32
>  ; CHECK: br i1
> -; CHECK: for.body.epil:
> -; CHECK: store
> -; CHECK-NOT: store
> -; CHECK: br i1
>  define void @runtime_loop_with_enable(i32* nocapture %a, i32 %b) {
>  entry:
>    %cmp3 = icmp sgt i32 %b, 0
> @@ -351,13 +328,13 @@ for.end:
>  ; should be duplicated (original and 3x unrolled).
>  ;
>  ; CHECK-LABEL: @runtime_loop_with_count3(
> -; CHECK: for.body
> -; CHECK: store
> -; CHECK: store
> +; CHECK: for.body.prol:
>  ; CHECK: store
>  ; CHECK-NOT: store
>  ; CHECK: br i1
> -; CHECK: for.body.epil:
> +; CHECK: for.body
> +; CHECK: store
> +; CHECK: store
>  ; CHECK: store
>  ; CHECK-NOT: store
>  ; CHECK: br i1
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits



-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc


More information about the llvm-commits mailing list