Skip to content

[SelectionDAG] Update documentation for VECTOR_[DE]INTERLEAVE nodes. NFC #141644

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

Merged
merged 1 commit into from
May 28, 2025

Conversation

lukel97
Copy link
Contributor

@lukel97 lukel97 commented May 27, 2025

These can now support an arbitrary factor determined by the number of operands/results. Fixes #141565

These can now support an arbitrary factor determined by the number of operands/results. Fixes llvm#141565
@lukel97 lukel97 requested review from RKSimon, mshockwave and topperc May 27, 2025 17:55
@llvmbot llvmbot added the llvm:SelectionDAG SelectionDAGISel as well label May 27, 2025
@llvmbot
Copy link
Member

llvmbot commented May 27, 2025

@llvm/pr-subscribers-llvm-selectiondag

Author: Luke Lau (lukel97)

Changes

These can now support an arbitrary factor determined by the number of operands/results. Fixes #141565


Full diff: https://github.com/llvm/llvm-project/pull/141644.diff

1 Files Affected:

  • (modified) llvm/include/llvm/CodeGen/ISDOpcodes.h (+17-9)
diff --git a/llvm/include/llvm/CodeGen/ISDOpcodes.h b/llvm/include/llvm/CodeGen/ISDOpcodes.h
index 9f66402e4c820..b5752e21048d7 100644
--- a/llvm/include/llvm/CodeGen/ISDOpcodes.h
+++ b/llvm/include/llvm/CodeGen/ISDOpcodes.h
@@ -599,17 +599,25 @@ enum NodeType {
   /// vector, but not the other way around.
   EXTRACT_SUBVECTOR,
 
-  /// VECTOR_DEINTERLEAVE(VEC1, VEC2) - Returns two vectors with all input and
-  /// output vectors having the same type. The first output contains the even
-  /// indices from CONCAT_VECTORS(VEC1, VEC2), with the second output
-  /// containing the odd indices. The relative order of elements within an
-  /// output match that of the concatenated input.
+  /// VECTOR_DEINTERLEAVE(VEC1, VEC2, ...) - Returns N vectors from N input
+  /// vectors, where N is the factor to deinterleave. All input and output
+  /// vectors must have the same type.
+  ///
+  /// Each output contains the deinterleaved indices for a specific field from
+  /// CONCAT_VECTORS(VEC1, VEC2, ...):
+  ///
+  /// Result[I][J] = CONCAT_VECTORS(...)[I + N * J]
   VECTOR_DEINTERLEAVE,
 
-  /// VECTOR_INTERLEAVE(VEC1, VEC2) - Returns two vectors with all input and
-  /// output vectors having the same type. The first output contains the
-  /// result of interleaving the low half of CONCAT_VECTORS(VEC1, VEC2), with
-  /// the second output containing the result of interleaving the high half.
+  /// VECTOR_INTERLEAVE(VEC1, VEC2, ...) - Returns N vectors from N input
+  /// vectors, where N is the factor to interleave. All input and
+  /// output vectors must have the same type.
+  ///
+  /// All input vectors are interleaved into one wide vector, which is then
+  /// chunked into equal sized parts:
+  ///
+  /// Interleaved[I] = VEC(I % N)[I / N]
+  /// Result[J] = EXTRACT_SUBVECTOR(Interleaved, J * getVectorMinNumElements())
   VECTOR_INTERLEAVE,
 
   /// VECTOR_REVERSE(VECTOR) - Returns a vector, of the same type as VECTOR,

Copy link
Member

@mshockwave mshockwave left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@topperc topperc left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@RKSimon RKSimon left a comment

Choose a reason for hiding this comment

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

LGTM - cheers

@lukel97 lukel97 merged commit b577438 into llvm:main May 28, 2025
13 checks passed
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Jun 3, 2025
…NFC (llvm#141644)

These can now support an arbitrary factor determined by the number of
operands/results. Fixes llvm#141565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:SelectionDAG SelectionDAGISel as well
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DAG] ISD::VECTOR_INTERLEAVE and ISD::VECTOR_DEINTERLEAVE descriptions no longer match their behaviour
5 participants