-
Notifications
You must be signed in to change notification settings - Fork 17
If Index cast optimization #544
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
Conversation
Value value = result.value(); | ||
|
||
// Skip if the result is not an integer type that can be index-cast | ||
if (!value.getType().isIntOrIndex()) { |
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.
can we add a further restriction here if the yielded results are both constants?
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.
or I suppose if at least one of the yielded results are constants*
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.
[that way it is in some sense work reducing]
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.
Added this check
affine.if result if yields a constant with one user that does index cast on it. Then the index cast is moved inside the affine.if