[llvm] r345538 - [LoopUnroll] NFC. Factor out runtime-loop.ll common test behavior.

Fedor Sergeev via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 29 13:38:24 PDT 2018


Author: fedor.sergeev
Date: Mon Oct 29 13:38:23 2018
New Revision: 345538

URL: http://llvm.org/viewvc/llvm-project?rev=345538&view=rev
Log:
[LoopUnroll] NFC. Factor out runtime-loop.ll common test behavior.

Adding COMMON prefix to get common part handled there.
Needed to simplify test changes for D53440.

Modified:
    llvm/trunk/test/Transforms/LoopUnroll/runtime-loop.ll

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=345538&r1=345537&r2=345538&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoopUnroll/runtime-loop.ll (original)
+++ llvm/trunk/test/Transforms/LoopUnroll/runtime-loop.ll Mon Oct 29 13:38:23 2018
@@ -1,13 +1,15 @@
-; 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
+; RUN: opt < %s -S -loop-unroll -unroll-runtime=true -unroll-runtime-epilog=true  | FileCheck %s -check-prefixes=EPILOG,COMMON
+; RUN: opt < %s -S -loop-unroll -unroll-runtime=true -unroll-runtime-epilog=false | FileCheck %s -check-prefixes=PROLOG,COMMON
 
-; RUN: opt < %s -S -passes='require<opt-remark-emit>,unroll' -unroll-runtime=true -unroll-runtime-epilog=true  | FileCheck %s -check-prefix=EPILOG
-; RUN: opt < %s -S -passes='require<opt-remark-emit>,unroll' -unroll-runtime=true -unroll-runtime-epilog=false | FileCheck %s -check-prefix=PROLOG
+; RUN: opt < %s -S -passes='require<opt-remark-emit>,unroll' -unroll-runtime=true -unroll-runtime-epilog=true  | FileCheck %s -check-prefixes=EPILOG,COMMON
+; RUN: opt < %s -S -passes='require<opt-remark-emit>,unroll' -unroll-runtime=true -unroll-runtime-epilog=false | FileCheck %s -check-prefixes=PROLOG,COMMON
 
 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"
 
 ; Tests for unrolling loops with run-time trip counts
 
+; COMMON-LABEL: @test(
+
 ; EPILOG: %xtraiter = and i32 %n
 ; EPILOG:  %lcmp.mod = icmp ne i32 %xtraiter, 0
 ; EPILOG:  br i1 %lcmp.mod, label %for.body.epil.preheader, label %for.end.loopexit
@@ -54,11 +56,10 @@ for.end:
 ; Still try to completely unroll loops with compile-time trip counts
 ; even if the -unroll-runtime is specified
 
-; EPILOG: for.body:
-; EPILOG-NOT: for.body.epil:
-
-; PROLOG: for.body:
-; PROLOG-NOT: for.body.prol:
+; COMMON-LABEL: @test1(
+; COMMON: for.body:
+; COMMON-NOT: for.body.epil:
+; COMMON-NOT: for.body.prol:
 
 define i32 @test1(i32* nocapture %a) nounwind uwtable readonly {
 entry:
@@ -82,6 +83,7 @@ for.end:
 ; This is test 2007-05-09-UnknownTripCount.ll which can be unrolled now
 ; if the -unroll-runtime option is turned on
 
+; COMMON-LABEL: @foo(
 ; EPILOG: bb72.2:
 ; PROLOG: bb72.2:
 
@@ -105,6 +107,7 @@ cond_true138:
 
 ; Test run-time unrolling for a loop that counts down by -2.
 
+; COMMON-LABEL: @down(
 ; EPILOG: for.body.epil:
 ; EPILOG: br i1 %epil.iter.cmp, label %for.body.epil, label %for.cond.for.end_crit_edge.epilog-lcssa
 
@@ -138,6 +141,8 @@ for.end:
 }
 
 ; Test run-time unrolling disable metadata.
+; COMMON-LABEL: @test2(
+
 ; EPILOG: for.body:
 ; EPILOG-NOT: for.body.epil:
 
@@ -174,11 +179,9 @@ for.end:
 ; -runtime-unroll-multi-exit=true
 ; single exit, multiple exiting blocks.
 define void @unique_exit(i32 %arg) {
-; PROLOG: unique_exit(
-; PROLOG-NOT: .unr
+; COMMON-LABEL: @unique_exit(
+; COMMON-NOT: .unr
 
-; EPILOG: unique_exit(
-; EPILOG-NOT: .unr
 entry:
   %tmp = icmp sgt i32 undef, %arg
   br i1 %tmp, label %preheader, label %returnblock
@@ -206,11 +209,9 @@ latch:
 
 ; multiple exit blocks. don't unroll
 define void @multi_exit(i64 %trip, i1 %cond) {
-; PROLOG: multi_exit(
-; PROLOG-NOT: .unr
+; COMMON-LABEL: @multi_exit(
+; COMMON-NOT: .unr
 
-; EPILOG: multi_exit(
-; EPILOG-NOT: .unr
 entry:
   br label %loop_header
 
@@ -238,11 +239,15 @@ exit1:
 exit2.loopexit:
   ret void
 }
+
 !0 = distinct !{!0, !1}
 !1 = !{!"llvm.loop.unroll.runtime.disable"}
 
-; EPILOG: !0 = distinct !{!0, !1}
+; need to use LABEL here to separate function IR matching from metadata matching
+; COMMON-LABEL: {{^}}!0 =
+
+; EPILOG-SAME: distinct !{!0, !1}
 ; EPILOG: !1 = !{!"llvm.loop.unroll.disable"}
 
-; PROLOG: !0 = distinct !{!0, !1}
+; PROLOG-SAME: distinct !{!0, !1}
 ; PROLOG: !1 = !{!"llvm.loop.unroll.disable"}




More information about the llvm-commits mailing list