36 lines · plain
1;; Test to verify that when callee has inline assembly, bumping up `-inline-asm-instr-cost` would block inlining.2 3; RUN: opt < %s -passes=inline -S | FileCheck %s --check-prefixes=CHECK,INLINE4; RUN: opt < %s -passes='cgscc(inline)' -S | FileCheck %s --check-prefixes=CHECK,INLINE5 6;; Verify that a low assembly instruction cost of 150 does not block inlining.7;; This test also verifies that the outlined section's instructions (in "other"8;; section) do not contribute to the cost.9; RUN: opt < %s -passes=inline -inline-asm-instr-cost=150 -S | FileCheck %s --check-prefixes=CHECK,INLINE10; RUN: opt < %s -passes='cgscc(inline)' -inline-asm-instr-cost=150 -S | FileCheck %s --check-prefixes=CHECK,INLINE11 12;; Verify that an assembly instruction cost of 300 blocks inlining.13; RUN: opt < %s -passes=inline -inline-asm-instr-cost=300 -S | FileCheck %s --check-prefixes=CHECK,NOINLINE14; RUN: opt < %s -passes='cgscc(inline)' -inline-asm-instr-cost=300 -S | FileCheck %s --check-prefixes=CHECK,NOINLINE15 16define void @caller(i32 %a, i1 %b) #0 {17 call void @callee(i32 %a, i1 %b)18 ret void19}20 21; CHECK: define void @caller22; INLINE: call void asm23; NOINLINE: call void @callee24 25 26;; callee function with asm call with two real assembly instructions in the27;; destination section and two assembly instructions in the outlined "other"28;; section.29define void @callee(i32 %a, i1 %b) {30 call void asm sideeffect "s_nop 1\0A\09.pushsection other\0A\09s_nop 2\0A\09s_nop 3\0A\09.popsection\0A\09s_nop 4\0A\09.align 32", ""()31 ret void32}33; CHECK: define void @callee34 35 36