-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Add a new memcpy propagation pass #7443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 11 commits
808d353
935c616
db42ae8
96127a8
449e2ac
537bd79
df971f6
9b25911
c1ec6b9
201945d
1cbfc91
ebebb22
df03d6f
b9c4df5
2df3b07
c09ab61
6e6444a
abc5e95
d0ca28b
6979283
c2e75cd
d1553e6
002320e
e4333be
f69ab63
dd7a2bf
39cc598
5b72fea
816fd00
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -73,6 +73,11 @@ impl BlockArgument { | |||||
| } | ||||||
| None | ||||||
| } | ||||||
|
|
||||||
| /// Get that Value that this argument represents. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| pub fn as_value(&self, context: &Context) -> Value { | ||||||
| self.block.get_arg(context, self.idx).unwrap() | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| /// Each block may be explicitly named. A [`Label`] is a simple `String` synonym. | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,6 +208,13 @@ impl Function { | |
| Ok(()) | ||
| } | ||
|
|
||
| /// Remove instructions from function that satisfy a given predicate. | ||
| pub fn remove_instructions<T: Fn(Value) -> bool>(&self, context: &mut Context, pred: T) { | ||
| for block in context.functions[self.0].blocks.clone() { | ||
| block.remove_instructions(context, &pred); | ||
| } | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Predicate Reference Mismatch in Instruction RemovalThe |
||
|
|
||
| /// Get a new unique block label. | ||
| /// | ||
| /// If `hint` is `None` then the label will be in the form `"blockN"` where N is an | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.