diff options
Diffstat (limited to 'test/Transforms/LoopUnroll/tripcount-overflow.ll')
-rw-r--r-- | test/Transforms/LoopUnroll/tripcount-overflow.ll | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/test/Transforms/LoopUnroll/tripcount-overflow.ll b/test/Transforms/LoopUnroll/tripcount-overflow.ll index 052077cdd5dd7..7156629af6d1e 100644 --- a/test/Transforms/LoopUnroll/tripcount-overflow.ll +++ b/test/Transforms/LoopUnroll/tripcount-overflow.ll @@ -1,4 +1,5 @@ -; RUN: opt < %s -S -unroll-runtime -unroll-count=2 -loop-unroll | FileCheck %s +; 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=false | FileCheck %s -check-prefix=PROLOG target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" ; This test case documents how runtime loop unrolling handles the case @@ -9,17 +10,28 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" ; is divisible by 2. The prologue then branches to the unrolled loop ; and executes the 2^32 iterations there, in groups of 2. +; EPILOG: entry: -; CHECK: entry: -; CHECK-NEXT: %0 = add i32 %N, 1 -; CHECK-NEXT: %xtraiter = and i32 %0, 1 -; CHECK-NEXT: %lcmp.mod = icmp ne i32 %xtraiter, 0 -; CHECK-NEXT: br i1 %lcmp.mod, label %while.body.prol, label %entry.split +; EPILOG-NEXT: %0 = add i32 %N, 1 +; EPILOG-NEXT: %xtraiter = and i32 %0, 1 +; EPILOG-NEXT: %1 = icmp ult i32 %N, 1 +; EPILOG-NEXT: br i1 %1, label %while.end.unr-lcssa, label %entry.new +; EPILOG: while.body: -; CHECK: while.body.prol: -; CHECK: br label %entry.split +; EPILOG: %lcmp.mod = icmp ne i32 %xtraiter, 0 +; EPILOG-NEXT: br i1 %lcmp.mod, label %while.body.epil.preheader, label %while.end +; EPILOG: while.body.epil: -; CHECK: entry.split: +; PROLOG: entry: +; PROLOG-NEXT: %0 = add i32 %N, 1 +; PROLOG-NEXT: %xtraiter = and i32 %0, 1 +; PROLOG-NEXT: %lcmp.mod = icmp ne i32 %xtraiter, 0 +; PROLOG-NEXT: br i1 %lcmp.mod, label %while.body.prol.preheader, label %while.body.prol.loopexit +; PROLOG: while.body.prol: + +; PROLOG: %1 = icmp ult i32 %N, 1 +; PROLOG-NEXT: br i1 %1, label %while.end, label %entry.new +; PROLOG: while.body: ; Function Attrs: nounwind readnone ssp uwtable define i32 @foo(i32 %N) { |