[llvm] Account for inline assembly instructions in inlining cost. (PR #146628)
Mingming Liu via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 2 11:17:22 PDT 2025
================
@@ -0,0 +1,23 @@
+;; Test to verify that when callee has inline assembly, bumping up `-inline-asm-instr-cost` would block inlining.
+
+; RUN: opt < %s -passes=inline -S | FileCheck %s --check-prefixes=INLINE
+; RUN: opt < %s -passes='cgscc(inline)' -S | FileCheck %s --check-prefixes=INLINE
+; RUN: opt < %s -passes=inline -inline-asm-instr-cost=150 -S | FileCheck %s --check-prefixes=INLINE
+; RUN: opt < %s -passes='cgscc(inline)' -inline-asm-instr-cost=150 -S | FileCheck %s --check-prefixes=INLINE
+; RUN: opt < %s -passes=inline -inline-asm-instr-cost=300 -S | FileCheck %s --check-prefixes=NOINLINE
----------------
mingmingl-llvm wrote:
nit: Add some comment to explain why 150 gives inline and 300 gives noline, like, which existing option(s) implicitly takes effect? Considering overriding them in the regression test if possible.
https://github.com/llvm/llvm-project/pull/146628
More information about the llvm-commits
mailing list