mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
testcase for the recent inliner improvement.
llvm-svn: 28643
This commit is contained in:
parent
3300df2fb9
commit
a3888ec9bb
40
test/Regression/Transforms/Inline/inline_prune.ll
Normal file
40
test/Regression/Transforms/Inline/inline_prune.ll
Normal file
@ -0,0 +1,40 @@
|
||||
; RUN: llvm-as < %s | opt -inline -disable-output &&
|
||||
; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep 'callee[12](' &&
|
||||
; RUN: llvm-as < %s | opt -inline | llvm-dis | not grep mul
|
||||
|
||||
implementation
|
||||
|
||||
internal int %callee1(int %A, int %B) {
|
||||
%cond = seteq int %A, 123
|
||||
br bool %cond, label %T, label %F
|
||||
T:
|
||||
%C = mul int %B, %B
|
||||
ret int %C
|
||||
F:
|
||||
ret int 0
|
||||
}
|
||||
|
||||
internal int %callee2(int %A, int %B) {
|
||||
switch int %A, label %T [
|
||||
int 10, label %F
|
||||
int 1234, label %G
|
||||
]
|
||||
%cond = seteq int %A, 123
|
||||
br bool %cond, label %T, label %F
|
||||
T:
|
||||
%C = mul int %B, %B
|
||||
ret int %C
|
||||
F:
|
||||
ret int 0
|
||||
G:
|
||||
%D = mul int %B, %B
|
||||
%E = mul int %D, %B
|
||||
ret int %E
|
||||
}
|
||||
|
||||
int %test(int %A) {
|
||||
%X = call int %callee1(int 10, int %A)
|
||||
%Y = call int %callee2(int 10, int %A)
|
||||
%Z = add int %X, %Y
|
||||
ret int %Z
|
||||
}
|
Loading…
Reference in New Issue
Block a user