Skip to content

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

arpitj1
Copy link
Contributor

@arpitj1 arpitj1 commented Mar 28, 2025

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

Value value = result.value();

// Skip if the result is not an integer type that can be index-cast
if (!value.getType().isIntOrIndex()) {
Copy link
Member

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?

Copy link
Member

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*

Copy link
Member

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]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this check

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants