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
401e1d36
Commit
401e1d36
authored
1 month ago
by
Russel Arbore
Browse files
Options
Downloads
Patches
Plain Diff
Possible fix to fork split
parent
3b491c96
No related branches found
No related tags found
1 merge request
!132
Possible fix to fork split
Pipeline
#201217
passed
1 month ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hercules_ir/src/loops.rs
+13
-5
13 additions, 5 deletions
hercules_ir/src/loops.rs
with
13 additions
and
5 deletions
hercules_ir/src/loops.rs
+
13
−
5
View file @
401e1d36
...
...
@@ -248,6 +248,14 @@ pub fn reduce_cycles(
for
reduce
in
reduces
{
let
(
join
,
_
,
reduct
)
=
function
.nodes
[
reduce
.idx
()]
.try_reduce
()
.unwrap
();
let
fork
=
join_fork_map
[
&
join
];
let
isnt_outside_fork_join
=
|
id
:
NodeID
|
{
let
node
=
&
function
.nodes
[
id
.idx
()];
node
.try_phi
()
.map
(|(
control
,
_
)|
control
)
.or
(
node
.try_reduce
()
.map
(|(
control
,
_
,
_
)|
control
))
.map
(|
control
|
fork_join_nest
[
&
fork
]
.contains
(
&
control
))
.unwrap_or
(
true
)
};
// First, find all data nodes that are used by the `reduct` input of the
// reduce, including the `reduct` itself.
...
...
@@ -258,10 +266,7 @@ pub fn reduce_cycles(
for
u
in
get_uses
(
&
function
.nodes
[
item
.idx
()])
.as_ref
()
{
if
!
function
.nodes
[
u
.idx
()]
.is_control
()
&&
!
use_reachable
.contains
(
u
)
&&
function
.nodes
[
u
.idx
()]
.try_phi
()
.map
(|(
control
,
_
)|
fork_join_nest
[
&
fork
]
.contains
(
&
control
))
.unwrap_or
(
true
)
&&
isnt_outside_fork_join
(
*
u
)
{
use_reachable
.insert
(
*
u
);
worklist
.push
(
*
u
);
...
...
@@ -274,7 +279,10 @@ pub fn reduce_cycles(
let
mut
worklist
=
vec!
[
reduce
];
while
let
Some
(
item
)
=
worklist
.pop
()
{
for
u
in
def_use
.get_users
(
item
)
{
if
!
function
.nodes
[
u
.idx
()]
.is_control
()
&&
!
user_reachable
.contains
(
u
)
{
if
!
function
.nodes
[
u
.idx
()]
.is_control
()
&&
!
user_reachable
.contains
(
u
)
&&
isnt_outside_fork_join
(
*
u
)
{
user_reachable
.insert
(
*
u
);
worklist
.push
(
*
u
);
}
...
...
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