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
c0968c72
Commit
c0968c72
authored
20 years ago
by
Chris Lattner
Browse files
Options
Downloads
Patches
Plain Diff
new testcase for a simple optimization that simplifycfg is about to do.
All CFG edges to DEAD should be eliminated. llvm-svn: 20299
parent
47ac187c
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/Regression/Transforms/SimplifyCFG/switch_thread.ll
+78
-0
78 additions, 0 deletions
llvm/test/Regression/Transforms/SimplifyCFG/switch_thread.ll
with
78 additions
and
0 deletions
llvm/test/Regression/Transforms/SimplifyCFG/switch_thread.ll
0 → 100644
+
78
−
0
View file @
c0968c72
; RUN: llvm-as < %s | opt -simplifycfg | llvm-dis | not grep 'call void %DEAD'
; Test that we can thread a simple known condition through switch statements.
declare
void
%foo1
()
declare
void
%foo2
()
declare
void
%DEAD
()
void
%test1
(
uint
%V
)
{
switch
uint
%V
,
label
%A
[
uint
4
,
label
%T
uint
17
,
label
%Done
uint
1234
,
label
%A
]
T:
;; V == 4 if we get here.
call
void
%foo1
()
;; This switch is always statically determined.
switch
uint
%V
,
label
%A2
[
uint
4
,
label
%B
uint
17
,
label
%C
uint
42
,
label
%C
]
A2:
call
void
%DEAD
()
call
void
%DEAD
()
%cond2
=
seteq
uint
%V
,
4
;; always false
br
bool
%cond2
,
label
%Done
,
label
%C
A:
call
void
%foo1
()
%cond
=
setne
uint
%V
,
4
;; always true
br
bool
%cond
,
label
%Done
,
label
%C
Done:
ret
void
B:
call
void
%foo2
()
%cond3
=
seteq
uint
%V
,
4
;; always true
br
bool
%cond3
,
label
%Done
,
label
%C
C:
call
void
%DEAD
()
ret
void
}
void
%test2
(
uint
%V
)
{
switch
uint
%V
,
label
%A
[
uint
4
,
label
%T
uint
17
,
label
%D
uint
1234
,
label
%E
]
A:
;; V != 4, 17, 1234 here.
call
void
%foo1
()
;; This switch is always statically determined.
switch
uint
%V
,
label
%E
[
uint
4
,
label
%C
uint
17
,
label
%C
uint
42
,
label
%D
]
C:
call
void
%DEAD
()
;; unreacahble.
ret
void
T:
call
void
%foo1
()
call
void
%foo1
()
ret
void
D:
call
void
%foo1
()
ret
void
E:
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