brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 0395b6a Raw
47 lines · plain
1; RUN: opt -S -Oz < %s | FileCheck %s -check-prefix=OZ2; RUN: opt -S -O2 < %s | FileCheck %s -check-prefix=O23; RUN: opt -S -Os < %s | FileCheck %s -check-prefix=OS4 5; The inline threshold for a function with the optsize attribute is currently6; the same as the global inline threshold for -Os. Check that the optsize7; function attribute doesn't alter the function-specific inline threshold if the8; global inline threshold is lower (as for -Oz).9 10@a = global i32 411 12; This function should be larger than the inline threshold for -Oz (25), but13; smaller than the inline threshold for optsize (75).14define i32 @inner() {15  call void @extern()16  %a1 = load volatile i32, ptr @a17  %x1 = add i32 %a1,  %a118  %a2 = load volatile i32, ptr @a19  %x2 = add i32 %x1, %a220  %a3 = load volatile i32, ptr @a21  %x3 = add i32 %x2, %a322  %a4 = load volatile i32, ptr @a23  %x4 = add i32 %x3, %a424  %a5 = load volatile i32, ptr @a25  %x5 = add i32 %x3, %a526  ret i32 %x527}28 29; @inner() should be inlined for -O2 and -Os but not for -Oz.30; OZ: call31; O2-NOT: call32; OS-NOT: call33define i32 @outer() optsize {34   %r = call i32 @inner()35   ret i32 %r36}37 38; @inner() should not be inlined for -O2, -Os and -Oz.39; OZ: call40; O2: call41; OS: call42define i32 @outer2() minsize {43   %r = call i32 @inner()44   ret i32 %r45}46 47declare void @extern()