Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
18021a45
Commit
18021a45
authored
12 years ago
by
Andrew Trick
Browse files
Options
Downloads
Patches
Plain Diff
tabs-to-spaces
llvm-svn: 171550
parent
43fafaf4
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/LICM/scalar_promote.ll
+43
-44
43 additions, 44 deletions
llvm/test/Transforms/LICM/scalar_promote.ll
with
43 additions
and
44 deletions
llvm/test/Transforms/LICM/scalar_promote.ll
+
43
−
44
View file @
18021a45
; RUN: opt < %s -basicaa -tbaa -licm -S | FileCheck %s
target
datalayout
=
"E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
@X
=
global
i32
7
; <i32*> [#uses=4]
@X
=
global
i32
7
; <i32*> [#uses=4]
define
void
@test1
(
i32
%i
)
{
Entry:
br
label
%Loop
br
label
%Loop
; CHECK: @test1
; CHECK: Entry:
; CHECK-NEXT: load i32* @X
; CHECK-NEXT: br label %Loop
Loop:
; preds = %Loop, %0
%j
=
phi
i32
[
0
,
%Entry
],
[
%Next
,
%Loop
]
; <i32> [#uses=1]
%x
=
load
i32
*
@X
; <i32> [#uses=1]
%x2
=
add
i32
%x
,
1
; <i32> [#uses=1]
store
i32
%x2
,
i32
*
@X
%Next
=
add
i32
%j
,
1
; <i32> [#uses=2]
%cond
=
icmp
eq
i32
%Next
,
0
; <i1> [#uses=1]
br
i1
%cond
,
label
%Out
,
label
%Loop
Loop:
; preds = %Loop, %0
%j
=
phi
i32
[
0
,
%Entry
],
[
%Next
,
%Loop
]
; <i32> [#uses=1]
%x
=
load
i32
*
@X
; <i32> [#uses=1]
%x2
=
add
i32
%x
,
1
; <i32> [#uses=1]
store
i32
%x2
,
i32
*
@X
%Next
=
add
i32
%j
,
1
; <i32> [#uses=2]
%cond
=
icmp
eq
i32
%Next
,
0
; <i1> [#uses=1]
br
i1
%cond
,
label
%Out
,
label
%Loop
Out:
ret
void
Out:
ret
void
; CHECK: Out:
; CHECK-NEXT: store i32 %x2, i32* @X
; CHECK-NEXT: ret void
...
...
@@ -31,22 +31,22 @@ Out:
define
void
@test2
(
i32
%i
)
{
Entry:
br
label
%Loop
br
label
%Loop
; CHECK: @test2
; CHECK: Entry:
; CHECK-NEXT: %.promoted = load i32* getelementptr inbounds (i32* @X, i64 1)
; CHECK-NEXT: br label %Loop
Loop:
; preds = %Loop, %0
%X1
=
getelementptr
i32
*
@X
,
i64
1
; <i32*> [#uses=1]
%A
=
load
i32
*
%X1
; <i32> [#uses=1]
%V
=
add
i32
%A
,
1
; <i32> [#uses=1]
%X2
=
getelementptr
i32
*
@X
,
i64
1
; <i32*> [#uses=1]
store
i32
%V
,
i32
*
%X2
br
i1
false
,
label
%Loop
,
label
%Exit
Loop:
; preds = %Loop, %0
%X1
=
getelementptr
i32
*
@X
,
i64
1
; <i32*> [#uses=1]
%A
=
load
i32
*
%X1
; <i32> [#uses=1]
%V
=
add
i32
%A
,
1
; <i32> [#uses=1]
%X2
=
getelementptr
i32
*
@X
,
i64
1
; <i32*> [#uses=1]
store
i32
%V
,
i32
*
%X2
br
i1
false
,
label
%Loop
,
label
%Exit
Exit:
; preds = %Loop
ret
void
Exit:
; preds = %Loop
ret
void
; CHECK: Exit:
; CHECK-NEXT: store i32 %V, i32* getelementptr inbounds (i32* @X, i64 1)
; CHECK-NEXT: ret void
...
...
@@ -56,19 +56,19 @@ Exit: ; preds = %Loop
define
void
@test3
(
i32
%i
)
{
; CHECK: @test3
br
label
%Loop
br
label
%Loop
Loop:
; Should not promote this to a register
%x
=
load
volatile
i32
*
@X
%x2
=
add
i32
%x
,
1
store
i32
%x2
,
i32
*
@X
br
i1
true
,
label
%Out
,
label
%Loop
%x
=
load
volatile
i32
*
@X
%x2
=
add
i32
%x
,
1
store
i32
%x2
,
i32
*
@X
br
i1
true
,
label
%Out
,
label
%Loop
; CHECK: Loop:
; CHECK-NEXT: load volatile
Out:
; preds = %Loop
ret
void
Out:
; preds = %Loop
ret
void
}
; PR8041
...
...
@@ -120,27 +120,27 @@ exit:
define
void
@test5
(
i32
%i
,
i32
**
noalias
%P2
)
{
Entry:
br
label
%Loop
br
label
%Loop
; CHECK: @test5
; CHECK: Entry:
; CHECK-NEXT: load i32* @X
; CHECK-NEXT: br label %Loop
Loop:
; preds = %Loop, %0
%j
=
phi
i32
[
0
,
%Entry
],
[
%Next
,
%Loop
]
; <i32> [#uses=1]
%x
=
load
i32
*
@X
; <i32> [#uses=1]
%x2
=
add
i32
%x
,
1
; <i32> [#uses=1]
store
i32
%x2
,
i32
*
@X
Loop:
; preds = %Loop, %0
%j
=
phi
i32
[
0
,
%Entry
],
[
%Next
,
%Loop
]
; <i32> [#uses=1]
%x
=
load
i32
*
@X
; <i32> [#uses=1]
%x2
=
add
i32
%x
,
1
; <i32> [#uses=1]
store
i32
%x2
,
i32
*
@X
store
volatile
i32
*
@X
,
i32
**
%P2
%Next
=
add
i32
%j
,
1
; <i32> [#uses=2]
%cond
=
icmp
eq
i32
%Next
,
0
; <i1> [#uses=1]
br
i1
%cond
,
label
%Out
,
label
%Loop
%Next
=
add
i32
%j
,
1
; <i32> [#uses=2]
%cond
=
icmp
eq
i32
%Next
,
0
; <i1> [#uses=1]
br
i1
%cond
,
label
%Out
,
label
%Loop
Out:
ret
void
Out:
ret
void
; CHECK: Out:
; CHECK-NEXT: store i32 %x2, i32* @X
; CHECK-NEXT: ret void
...
...
@@ -174,7 +174,7 @@ for.cond.for.end_crit_edge: ; preds = %for.body
for.end:
; preds = %for.cond.for.end_crit_edge, %entry
ret
void
; CHECK: for.body.lr.ph:
; CHECK-NEXT: %gi.promoted = load i32* %gi, align 4, !tbaa !0
; CHECK: for.cond.for.end_crit_edge:
...
...
@@ -185,4 +185,3 @@ for.end: ; preds = %for.cond.for.end_cr
!1
=
metadata
!{
metadata
!"omnipotent char"
,
metadata
!2
}
!2
=
metadata
!{
metadata
!"Simple C/C++ TBAA"
}
!3
=
metadata
!{
metadata
!"float"
,
metadata
!1
}
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