Skip to content

[AIEX] Unified Opcodes across Subtargets#766

Draft
F-Stuckmann wants to merge 3 commits intoaie-publicfrom
stuckmann.unified.opcodes
Draft

[AIEX] Unified Opcodes across Subtargets#766
F-Stuckmann wants to merge 3 commits intoaie-publicfrom
stuckmann.unified.opcodes

Conversation

@F-Stuckmann
Copy link
Copy Markdown
Collaborator

@F-Stuckmann F-Stuckmann commented Jan 30, 2026

Unify Opcodes so that we now work on generic opcodes.

@martien-de-jong I think we could also move the legalizer into tablegen.

Comment thread llvm/include/llvm/Target/Target.td Outdated
// Indicates if this instruction is shared across AIE targets and should be
// placed in a stable enum layer (Layer 2) between target-defined generics
// and target-specific instructions.
bit isAIEShared = false;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can't refer to AIE in this file.

Comment thread llvm/lib/Target/AIE/AIEInstrGISel.td Outdated
@@ -60,6 +60,7 @@ let InOperandList = (ins type2:$val, type0:$base, type1:$modifier, type1:$size1,
// after extracting the element from a vector. This gMIR is added
// to avoid zero extending smaller size elements (S8, S16) to S32
def G_AIE_ZEXT_EXTRACT_VECTOR_ELT : AIEGenericInstruction {
let AccessorMethod = "getGenericZExtExtractVectorEltOpcode";
Copy link
Copy Markdown
Collaborator

@martien-de-jong martien-de-jong Feb 24, 2026

Choose a reason for hiding this comment

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

Since we have unified the enumerations wrt generic opcodes, can't we just use the different namespaces interchangeably without ever using these accessors? The existing getGenericZExtExtractVectorEltOpcode() is obsolescent, and will in due time be replaced with the equivalent AIE::G_ZEXT_EXTRACT_ELT (or whatever).
Later we can even remove the generic opcodes from the specific enums.

@F-Stuckmann F-Stuckmann force-pushed the stuckmann.unified.opcodes branch from f3268ce to f6f9a81 Compare March 6, 2026 15:09
Copy link
Copy Markdown
Collaborator

@mludevid mludevid left a comment

Choose a reason for hiding this comment

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

Would it be possible to share the definitions of the instructions? As in instead of making sure that they are defined in all AIE targets centralize the definition and all targets include that central definition. We can still keep the check to make sure we didn't miss anything.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe move this to the next commit? Keep this as an aligning opcodes between targets commit and then in the next one add the checks that enforce this.

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