Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
llvm-epi
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Roger Ferrer
llvm-epi
Commits
6d016086
Commit
6d016086
authored
15 years ago
by
Edward O'Callaghan
Browse files
Options
Downloads
Patches
Plain Diff
Convert InstCombine/call.ll to CheckFile.
llvm-svn: 83833
parent
cbf75a5d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/test/Transforms/InstCombine/call.ll
+22
-3
22 additions, 3 deletions
llvm/test/Transforms/InstCombine/call.ll
with
22 additions
and
3 deletions
llvm/test/Transforms/InstCombine/call.ll
+
22
−
3
View file @
6d016086
; Ignore stderr, we expect warnings there
; Ignore stderr, we expect warnings there
; RUN: opt < %s -instcombine 2> /dev/null -S | \
; RUN: opt < %s -instcombine 2> /dev/null -S | CheckFile %s
; RUN: grep call | notcast
; END.
; Simple case, argument translatable without changing the value
; Simple case, argument translatable without changing the value
...
@@ -10,17 +8,24 @@ declare void @test1a(i8*)
...
@@ -10,17 +8,24 @@ declare void @test1a(i8*)
define
void
@test1
(
i32
*
%A
)
{
define
void
@test1
(
i32
*
%A
)
{
call
void
bitcast
(
void
(
i8
*)*
@test1a
to
void
(
i32
*)*)(
i32
*
%A
)
call
void
bitcast
(
void
(
i8
*)*
@test1a
to
void
(
i32
*)*)(
i32
*
%A
)
ret
void
ret
void
; CHECK: %tmp = bitcast i32* %A to i8*
; CHECK: call void @test1a(i8* %tmp)
; CHECK: ret void
}
}
; More complex case, translate argument because of resolution. This is safe
; More complex case, translate argument because of resolution. This is safe
; because we have the body of the function
; because we have the body of the function
define
void
@test2a
(
i8
%A
)
{
define
void
@test2a
(
i8
%A
)
{
ret
void
ret
void
; CHECK: ret void
}
}
define
i32
@test2
(
i32
%A
)
{
define
i32
@test2
(
i32
%A
)
{
call
void
bitcast
(
void
(
i8
)*
@test2a
to
void
(
i32
)*)(
i32
%A
)
call
void
bitcast
(
void
(
i8
)*
@test2a
to
void
(
i32
)*)(
i32
%A
)
ret
i32
%A
ret
i32
%A
; CHECK: %tmp = trunc i32 %A to i8
; CHECK: call void @test2a(i8 %tmp)
; CHECK: ret i32 %A
}
}
...
@@ -32,17 +37,24 @@ define void @test3(i8 %A, i8 %B) {
...
@@ -32,17 +37,24 @@ define void @test3(i8 %A, i8 %B) {
call
void
bitcast
(
void
(
i8
,
...)*
@test3a
to
void
(
i8
,
i8
)*)(
i8
%A
,
i8
%B
call
void
bitcast
(
void
(
i8
,
...)*
@test3a
to
void
(
i8
,
i8
)*)(
i8
%A
,
i8
%B
)
)
ret
void
ret
void
; CHECK: %tmp = zext i8 %B to i32
; CHECK: call void (i8, ...)* @test3a(i8 %A, i32 %tmp)
; CHECK: ret void
}
}
; test conversion of return value...
; test conversion of return value...
define
i8
@test4a
()
{
define
i8
@test4a
()
{
ret
i8
0
ret
i8
0
; CHECK: ret i8 0
}
}
define
i32
@test4
()
{
define
i32
@test4
()
{
%X
=
call
i32
bitcast
(
i8
()*
@test4a
to
i32
()*)(
)
; <i32> [#uses=1]
%X
=
call
i32
bitcast
(
i8
()*
@test4a
to
i32
()*)(
)
; <i32> [#uses=1]
ret
i32
%X
ret
i32
%X
; CHECK: %X1 = call i8 @test4a()
%tmp
=
zext
i8
%X1
to
i32
ret
i32
%tmp
}
}
...
@@ -53,6 +65,8 @@ declare i32 @test5a()
...
@@ -53,6 +65,8 @@ declare i32 @test5a()
define
i32
@test5
()
{
define
i32
@test5
()
{
%X
=
call
i32
@test5a
(
)
; <i32> [#uses=1]
%X
=
call
i32
@test5a
(
)
; <i32> [#uses=1]
ret
i32
%X
ret
i32
%X
; CHECK: %X = call i32 @test5a()
; CHECK: ret i32 %X
}
}
...
@@ -62,17 +76,22 @@ declare i32 @test6a(i32)
...
@@ -62,17 +76,22 @@ declare i32 @test6a(i32)
define
i32
@test6
()
{
define
i32
@test6
()
{
%X
=
call
i32
bitcast
(
i32
(
i32
)*
@test6a
to
i32
()*)(
)
; <i32> [#uses=1]
%X
=
call
i32
bitcast
(
i32
(
i32
)*
@test6a
to
i32
()*)(
)
; <i32> [#uses=1]
ret
i32
%X
ret
i32
%X
; CHECK: %X1 = call i32 @test6a(i32 0)
; CHECK: ret i32 %X1
}
}
; test removal of arguments, only can happen with a function body
; test removal of arguments, only can happen with a function body
define
void
@test7a
()
{
define
void
@test7a
()
{
ret
void
ret
void
; CHECK: ret void
}
}
define
void
@test7
()
{
define
void
@test7
()
{
call
void
bitcast
(
void
()*
@test7a
to
void
(
i32
)*)(
i32
5
)
call
void
bitcast
(
void
()*
@test7a
to
void
(
i32
)*)(
i32
5
)
ret
void
ret
void
; CHECK: call void @test7a()
; CHECK: ret void
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment