36 lines · plain
1; Default behavior2; RUN: opt < %s -passes='loop-unroll' -S | FileCheck %s -check-prefixes=ENABLE,COMMON3 4; Pass option5; RUN: opt < %s -passes='loop-unroll<full-unroll-max=0>' -S | FileCheck %s -check-prefixes=DISABLE,COMMON6; RUN: opt < %s -passes='loop-unroll<full-unroll-max=30>' -S | FileCheck %s -check-prefixes=DISABLE,COMMON7; RUN: opt < %s -passes='loop-unroll<full-unroll-max=36>' -S | FileCheck %s -check-prefixes=ENABLE,COMMON8 9; cl::opt option10; RUN: opt < %s -passes='loop-unroll' -unroll-full-max-count=0 -S | FileCheck %s -check-prefixes=DISABLE,COMMON11; RUN: opt < %s -passes='loop-unroll' -unroll-full-max-count=30 -S | FileCheck %s -check-prefixes=DISABLE,COMMON12; RUN: opt < %s -passes='loop-unroll' -unroll-full-max-count=36 -S | FileCheck %s -check-prefixes=ENABLE,COMMON13 14; Pass option has a priority over cl::opt15; RUN: opt < %s -passes='loop-unroll<full-unroll-max=30>' -unroll-full-max-count=36 -S | FileCheck %s -check-prefixes=DISABLE,COMMON16; RUN: opt < %s -passes='loop-unroll<full-unroll-max=36>' -unroll-full-max-count=30 -S | FileCheck %s -check-prefixes=ENABLE,COMMON17 18define void @test() {19; COMMON-LABEL: @test(20 entry:21 br label %loop22 23 loop:24 %idx = phi i32 [ 0, %entry ], [ %idx.inc, %loop ]25 %idx.inc = add i32 %idx, 126 %be = icmp slt i32 %idx, 3227 br i1 %be, label %loop, label %exit28 29; COMMON: loop:30; DISABLE: %be = icmp slt i32 %idx, 3231; ENABLE-NOT: %be = icmp slt i32 %idx, 3232 33 exit:34 ret void35}36