Skip to content

[RTG] Add tuple operations #8370

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

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

[RTG] Add tuple operations #8370

wants to merge 16 commits into from

Conversation

maerhart
Copy link
Member

No description provided.

maerhart added 16 commits March 28, 2025 14:26
This adds an immediate type and attribute that support any bitwidth and will replace the immediate types and attributes in the RTGTest dialect. Also adds a constant operation that can create an SSA value for any typed attribute. I also moved the labels type to form a kind of ISA subdialect with the immediates and made that explicit in the textual IR. We can do the same for relevant ops in the future.
This is a first implementation for if-statements and for/foreach-loops. We probably want to iterate on that because the stack frame manipulations and accessing is not great.
Initially the idea was to use the index dialect for arithmetic because it is smaller and simpler (doesn't accept any kind of shape types that we have to error out for, etc.). However, the SCF dialect depends on arith and its canonicalizers produce arith ops. The easiest solution to properly support if-statements and for loops in RTG is thus to just add support for arith ops that can be produced by those canonicalizers to the elaboration pass.
@maerhart maerhart added the RTG Involving the `rtg` dialect label Mar 31, 2025
@maerhart maerhart requested review from youngar and darthscsi March 31, 2025 13:22
@maerhart maerhart force-pushed the maerhart-pyrtg-random-integer branch from 4747ca8 to 0d1e07d Compare April 15, 2025 10:28
Base automatically changed from maerhart-pyrtg-random-integer to main April 15, 2025 10:31
SmallVectorImpl<Type> &inferredReturnTypes) {
if (operands.empty()) {
if (loc)
return mlir::emitError(*loc) << "empty tuples not allowed";
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the reason for disallowing empty tuples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RTG Involving the `rtg` dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants