brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · c456038 Raw
36 lines · plain
1; REQUIRES: asserts2; RUN: opt < %s -S -Os -debug -debug-only=loop-rotate 2>&1 | FileCheck %s -check-prefix=OS3; RUN: opt < %s -S -Oz -debug -debug-only=loop-rotate 2>&1 | FileCheck %s -check-prefix=OZ4; RUN: opt < %s -S -passes='default<Os>' -debug -debug-only=loop-rotate 2>&1 | FileCheck %s -check-prefix=OS5; RUN: opt < %s -S -passes='default<Oz>' -debug -debug-only=loop-rotate 2>&1 | FileCheck %s -check-prefix=OZ6 7;; Make sure -allow-loop-header-duplication overrides the default behavior at Oz8; RUN: opt < %s -S -passes='default<Oz>' -enable-loop-header-duplication -debug -debug-only=loop-rotate 2>&1 | FileCheck %s -check-prefix=OS9 10; Loop should be rotated for -Os but not for -Oz.11; OS: rotating Loop at depth 112; OZ-NOT: rotating Loop at depth 113 14@e = global i32 1015 16declare void @use(i32)17 18define void @test() {19entry:20  %end = load i32, ptr @e21  br label %loop22 23loop:24  %n.phi = phi i32 [ %n, %loop.fin ], [ 0, %entry ]25  %cond = icmp eq i32 %n.phi, %end26  br i1 %cond, label %exit, label %loop.fin27 28loop.fin:29  %n = add i32 %n.phi, 130  call void @use(i32 %n)31  br label %loop32 33exit:34  ret void35}36