Skip to content

[Codegen] Add pass to remove iree_codegen.index_hint ops#23139

Merged
Max191 merged 2 commits intoiree-org:mainfrom
Max191:users/Max191/remove-index-hint-ops
Jan 16, 2026
Merged

[Codegen] Add pass to remove iree_codegen.index_hint ops#23139
Max191 merged 2 commits intoiree-org:mainfrom
Max191:users/Max191/remove-index-hint-ops

Conversation

@Max191
Copy link
Contributor

@Max191 Max191 commented Jan 15, 2026

Adds a pass to remove iree_codegen.index_hint operations. The pass unconditionally drops all index_hint ops, and should be used once the compiler is done using them for optimizations. The ops can get in the way of later optimizations, so this pass should be used to drop them once they are no longer needed.

The pass is not added to any pipelines, because we are not generating index_hint ops anywhere yet, but this pass will be added later once index_hints start to be used.

Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Copy link
Contributor

@hanhanW hanhanW left a comment

Choose a reason for hiding this comment

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

LGTM if the review comments are addressed.

Copy link
Contributor

@krzysz00 krzysz00 left a comment

Choose a reason for hiding this comment

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

I'd still like to see these index_hint ops implementing the integer inference interfaces

Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
@Max191
Copy link
Contributor Author

Max191 commented Jan 16, 2026

I'd still like to see these index_hint ops implementing the integer inference interfaces

We can add it, although I realized that for the current attributes that we have, the implementation would mostly just be to avoid blocking the analysis. The hints give very little information about the ranges/divisibilities of the index values, since they are more about how the index varies across lanes.

(other hint attributes could give more information, of course)

@Max191 Max191 merged commit 21867c3 into iree-org:main Jan 16, 2026
52 of 55 checks passed
@Max191 Max191 deleted the users/Max191/remove-index-hint-ops branch January 16, 2026 16:37
keshavvinayak01 pushed a commit that referenced this pull request Jan 27, 2026
Adds a pass to remove iree_codegen.index_hint operations. The pass
unconditionally drops all index_hint ops, and should be used once the
compiler is done using them for optimizations. The ops can get in the
way of later optimizations, so this pass should be used to drop them
once they are no longer needed.

The pass is not added to any pipelines, because we are not generating
index_hint ops anywhere yet, but this pass will be added later once
index_hints start to be used.

---------

Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Keshav Vinayak Jha <keshavvinayakjha@gmail.com>
MaheshRavishankar pushed a commit to MaheshRavishankar/iree that referenced this pull request Feb 24, 2026
)

Adds a pass to remove iree_codegen.index_hint operations. The pass
unconditionally drops all index_hint ops, and should be used once the
compiler is done using them for optimizations. The ops can get in the
way of later optimizations, so this pass should be used to drop them
once they are no longer needed.

The pass is not added to any pipelines, because we are not generating
index_hint ops anywhere yet, but this pass will be added later once
index_hints start to be used.

---------

Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants