Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
Hercules
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
llvm
Hercules
Commits
9309ab65
Commit
9309ab65
authored
4 months ago
by
Aaron Councilman
Browse files
Options
Downloads
Patches
Plain Diff
Another CCP bugfix
parent
e0daecde
No related branches found
No related tags found
1 merge request
!74
Another CCP bugfix
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hercules_opt/src/ccp.rs
+18
-5
18 additions, 5 deletions
hercules_opt/src/ccp.rs
juno_samples/nested_ccp/src/main.rs
+2
-1
2 additions, 1 deletion
juno_samples/nested_ccp/src/main.rs
juno_samples/nested_ccp/src/nested_ccp.jn
+4
-4
4 additions, 4 deletions
juno_samples/nested_ccp/src/nested_ccp.jn
with
24 additions
and
10 deletions
hercules_opt/src/ccp.rs
+
18
−
5
View file @
9309ab65
...
@@ -845,11 +845,24 @@ fn ccp_flow_function(
...
@@ -845,11 +845,24 @@ fn ccp_flow_function(
}
}
Node
::
Read
{
Node
::
Read
{
collect
,
collect
,
indices
:
_
,
indices
,
}
=>
CCPLattice
{
}
=>
{
reachability
:
inputs
[
collect
.idx
()]
.reachability
.clone
(),
let
mut
reachability
=
inputs
[
collect
.idx
()]
.reachability
.clone
();
constant
:
ConstantLattice
::
bottom
(),
for
index
in
indices
.iter
()
{
},
if
let
Index
::
Position
(
positions
)
=
index
{
for
position
in
positions
.iter
()
{
reachability
=
ReachabilityLattice
::
join
(
&
reachability
,
&
inputs
[
position
.idx
()]
.reachability
,
);
}
}
}
CCPLattice
{
reachability
,
constant
:
ConstantLattice
::
bottom
(),
}
}
// Projection handles reachability when following an if or match.
// Projection handles reachability when following an if or match.
Node
::
Projection
{
control
,
selection
}
=>
match
&
editor
.func
()
.nodes
[
control
.idx
()]
{
Node
::
Projection
{
control
,
selection
}
=>
match
&
editor
.func
()
.nodes
[
control
.idx
()]
{
Node
::
If
{
control
:
_
,
cond
}
=>
{
Node
::
If
{
control
:
_
,
cond
}
=>
{
...
...
This diff is collapsed.
Click to expand it.
juno_samples/nested_ccp/src/main.rs
+
2
−
1
View file @
9309ab65
...
@@ -8,8 +8,9 @@ juno_build::juno!("nested_ccp");
...
@@ -8,8 +8,9 @@ juno_build::juno!("nested_ccp");
fn
main
()
{
fn
main
()
{
async_std
::
task
::
block_on
(
async
{
async_std
::
task
::
block_on
(
async
{
let
mut
a
=
vec!
[
17.0
,
18.0
,
19.0
];
let
output
=
unsafe
{
let
output
=
unsafe
{
ccp_example
()
.await
ccp_example
(
a
.as_mut_ptr
()
)
.await
};
};
println!
(
"{}"
,
output
);
println!
(
"{}"
,
output
);
assert_eq!
(
output
,
1.0
);
assert_eq!
(
output
,
1.0
);
...
...
This diff is collapsed.
Click to expand it.
juno_samples/nested_ccp/src/nested_ccp.jn
+
4
−
4
View file @
9309ab65
#[entry]
#[entry]
fn
ccp_example
()
->
f32
{
fn
ccp_example
(
arg
:
f32
[
3
]
)
->
f32
{
let
x
:
f32
=
2
;
let
x
:
f32
=
2
;
if
x
<
3
{
if
x
<
3
{
x
=
1
;
x
=
1
;
}
else
{
}
else
{
if
x
==
1
{
if
x
==
1
{
x
=
4
;
x
=
3
;
}
else
{
}
else
{
x
=
1
;
x
=
7
;
}
}
}
}
if
false
{
for
i
=
0
to
3
by
1
{
}
}
if
false
{
for
i
=
0
to
3
by
1
{
x
=
arg
[
i
];
arg
[
i
]
=
0
;
}
}
return
x
;
return
x
;
}
}
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