Skip to content

[FRONTEND] Add get_int_attr to Operation for out-of-tree walk#8892

Merged
peterbell10 merged 2 commits intotriton-lang:mainfrom
jjvraw:op-get-int-attr
Dec 4, 2025
Merged

[FRONTEND] Add get_int_attr to Operation for out-of-tree walk#8892
peterbell10 merged 2 commits intotriton-lang:mainfrom
jjvraw:op-get-int-attr

Conversation

@jjvraw
Copy link
Copy Markdown
Contributor

@jjvraw jjvraw commented Dec 3, 2025

Enables extracting integer attributes from MLIR operations during
out-of-tree walks. Useful for extracting constant values as well
as attributes like start and end from tt.make_range, for example.

Follows the pattern established in PR #3191.

@jjvraw jjvraw requested a review from ptillet as a code owner December 3, 2025 15:29
@peterbell10 peterbell10 enabled auto-merge (squash) December 3, 2025 15:54
Enables extracting integer attributes from MLIR operations during
out-of-tree walks. Useful for extracting constant values as well
as attributes like start and end from tt.make_range, for example.

Follows the pattern established in PR triton-lang#3191.

Signed-off-by: Joshua James Venter <venter.joshua@gmail.com>
auto-merge was automatically disabled December 3, 2025 20:30

Head branch was pushed to by a user without write access

@peterbell10 peterbell10 merged commit 818135b into triton-lang:main Dec 4, 2025
9 checks passed
@jjvraw
Copy link
Copy Markdown
Contributor Author

jjvraw commented Dec 8, 2025

Just coming back to this, in some cases its useful to recover the splatted scalar value from DenseElementsAttr after lowering into tensor form.

Any thoughts on extending get_int_attr so arith.constants yields the scalar value when safe to do so (isSplat()), or introducing get_splat_int_attr?

...with no urgency, @peterbell10.

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.

3 participants