[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 12:39:59 PST 2022
kazu created this revision.
Herald added a project: All.
kazu requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
The new test ensures that the module inliner works with all currently
supported priority modes.
Different priority modes result in no difference in terms of the
output for these simple cases, so this is more of a "better than
nothing" test.
Repository:
rG LLVM Github Monorepo
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.479720.patch
Type: text/x-patch
Size: 836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221202/5ec254c6/attachment.bin>
More information about the llvm-commits
mailing list