-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[BACKEND] Extend hoisting of convert op above ext ops #2206
Conversation
Handle more cases of hoisting convert above ext op. If there are multiple ext op in the slice but only one requires inserting a convert we can still apply the optimization.
// If we can rematerialize the rest of the ext slice we can ignore this | ||
// ext as it won't need a convert. | ||
if (result.succeeded()) { | ||
slice.insert(tempSlice.begin(), tempSlice.end()); |
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.
Once the number of slice is changed, do you need to increase sliceSize
as well?
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.
no, we only want to go through the original slice since here we get a backward slice without stopping at ext anymore. This new slice will be rematerialized without the need for convert so we don't have to consider it in looking for an ext that requires a convert.
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.
Got you. That makes sense
// If we can rematerialize the rest of the ext slice we can ignore this | ||
// ext as it won't need a convert. | ||
if (result.succeeded()) { | ||
slice.insert(tempSlice.begin(), tempSlice.end()); |
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.
Got you. That makes sense
Handle more cases of hoisting convert above ext op. If there are multiple ext op in the slice but only one requires inserting a convert we can still apply the optimization.
Handle more cases of hoisting convert above ext op. If there are multiple ext op in the slice but only one requires inserting a convert we can still apply the optimization.