[PATCH] D139222: [Inline] Add a basic test for the module inliner

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 13:38:17 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0417b9d63735: [Inline] Add a basic test for the module inliner (authored by kazu).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139222/new/

https://reviews.llvm.org/D139222

Files:
  llvm/test/Transforms/Inline/module-inliner-basic.ll


Index: llvm/test/Transforms/Inline/module-inliner-basic.ll
===================================================================
--- /dev/null
+++ llvm/test/Transforms/Inline/module-inliner-basic.ll
@@ -0,0 +1,20 @@
+; RUN: opt -passes=module-inline                                    -S < %s | FileCheck %s
+; RUN: opt -passes=module-inline -inline-priority-mode=size         -S < %s | FileCheck %s
+; RUN: opt -passes=module-inline -inline-priority-mode=cost         -S < %s | FileCheck %s
+; RUN: opt -passes=module-inline -inline-priority-mode=cost-benefit -S < %s | FileCheck %s
+
+define i32 @callee(i32 %a) {
+entry:
+  %add = add nsw i32 %a, 1
+  ret i32 %add
+}
+
+define i32 @caller(i32 %a) {
+entry:
+  %call = call i32 @callee(i32 %a)
+  ret i32 %call
+}
+
+; CHECK-LABEL: @caller
+; CHECK-NOT:     call
+; CHECK:         ret


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139222.479738.patch
Type: text/x-patch
Size: 836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221202/ca6d2056/attachment.bin>


More information about the llvm-commits mailing list