33 lines · plain
1; REQUIRES: asserts2; RUN: opt < %s -S -passes=loop-rotate -debug -debug-only=loop-rotate 2>&1 | FileCheck %s3 4; Loop should not be rotated for functions with the minsize attribute.5; This is mostly useful for LTO which doesn't (yet) understand -Oz.6; CHECK: LoopRotation: NOT rotating - contains 2 instructions, which is more7 8@e = global i32 109 10declare void @use(i32)11 12; Function attrs: minsize optsize13define void @test() #0 {14entry:15 %end = load i32, ptr @e16 br label %loop17 18loop:19 %n.phi = phi i32 [ %n, %loop.fin ], [ 0, %entry ]20 %cond = icmp eq i32 %n.phi, %end21 br i1 %cond, label %exit, label %loop.fin22 23loop.fin:24 %n = add i32 %n.phi, 125 call void @use(i32 %n)26 br label %loop27 28exit:29 ret void30}31 32attributes #0 = { minsize optsize }33