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
8609f3f8
Commit
8609f3f8
authored
4 months ago
by
Xavier Routh
Committed by
rarbore2
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Loop bound lte
parent
0717de36
No related branches found
No related tags found
1 merge request
!207
Loop bound lte
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hercules_opt/src/forkify.rs
+6
-5
6 additions, 5 deletions
hercules_opt/src/forkify.rs
hercules_opt/src/loop_bound_canon.rs
+1
-2
1 addition, 2 deletions
hercules_opt/src/loop_bound_canon.rs
with
7 additions
and
7 deletions
hercules_opt/src/forkify.rs
+
6
−
5
View file @
8609f3f8
...
...
@@ -106,7 +106,7 @@ pub fn forkify_loop(
else
{
return
false
;
};
// Compute loop variance
let
loop_variance
=
compute_loop_variance
(
editor
,
l
);
let
ivs
=
compute_induction_vars
(
editor
.func
(),
l
,
&
loop_variance
);
...
...
@@ -530,10 +530,11 @@ pub fn analyze_phis<'a>(
let
intersection
:
HashSet
<
_
>
=
set1
.intersection
(
&
set2
)
.cloned
()
.collect
();
// If this phi uses any other phis the node is loop dependant,
// we use `phis` because this phi can actually contain the loop iv and its fine.
if
uses_for_dependance
.any
(|
node
|
phis
.contains
(
&
node
)
&&
node
!=
*
phi
)
{
LoopPHI
::
LoopDependant
(
*
phi
)
}
else
if
intersection
.clone
()
.iter
()
.next
()
.is_some
()
{
// // we use `phis` because this phi can actually contain the loop iv and its fine.
// if uses_for_dependance.any(|node| phis.contains(&node) && node != *phi) {
// LoopPHI::LoopDependant(*phi)
// } else
if
intersection
.clone
()
.iter
()
.next
()
.is_some
()
{
// PHIs on the frontier of the uses by the candidate phi, i.e in uses_for_dependance need
// to have headers that postdominate the loop continue latch. The value of the PHI used needs to be defined
// by the time the reduce is triggered (at the end of the loop's internal control).
...
...
This diff is collapsed.
Click to expand it.
hercules_opt/src/loop_bound_canon.rs
+
1
−
2
View file @
8609f3f8
...
...
@@ -275,7 +275,7 @@ pub fn canonicalize_single_loop_bounds(
let
new_binop_node
=
edit
.add_node
(
Node
::
Binary
{
left
,
right
:
blah
,
op
:
BinaryOperator
::
LT
});
edit
=
edit
.replace_all_uses_where
(
binop_node
,
new_binop_node
,
|
usee
|
*
usee
==
if_node
)
?
;
Some
((
init_id
,
b
ound_id
,
new_binop_node
,
if_node
))
Some
((
init_id
,
b
lah
,
new_binop_node
,
if_node
))
}
else
{
guard_info
};
edit
=
edit
.replace_all_uses_where
(
dc_bound_node
,
new_dc_bound_node
,
|
usee
|
*
usee
==
new_bop
)
?
;
...
...
@@ -289,7 +289,6 @@ pub fn canonicalize_single_loop_bounds(
};
Ok
(
edit
)
});
let
update_expr_users
:
Vec
<
_
>
=
editor
.get_users
(
*
update_expression
)
...
...
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