[clang] [llvm] [X86][AMX] Support AMX-TRANSPOSE (PR #113532)

Feng Zou via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 08:35:32 PDT 2024


================
@@ -34,9 +34,31 @@ class ShapeT {
     if (MRI)
       deduceImm(MRI);
   }
+  // When ShapeT has mult shapes, we only use Shapes (never use Row and Col)
+  // and ImmShapes. Due to the most case is only one shape (just simply use
+  // Shape.Row or Shape.Col), so here we don't merge Row and Col into vector
+  // Shapes to keep the speed and code simplicity.
+  // TODO: The upper solution is a temporary way to minimize current tile
+  // register allocation code changes. It can not handle both Reg shape and
+  // Imm shape for different shapes (e.g. shape 1 is reg shape while shape 2
+  // is imm shape). Refine me when we have more mult-tile shape instructions!
+  ShapeT(ArrayRef<MachineOperand *> ShapesOperands,
+         const MachineRegisterInfo *MRI = nullptr)
+      : Row(nullptr), Col(nullptr), RowImm(InvalidImmShape),
+        ColImm(InvalidImmShape) {
+    assert(ShapesOperands.size() % 2 == 0 && "Miss row or col!");
+
+    for (auto *Shape : ShapesOperands)
+      Shapes.push_back(Shape);
+
+    if (MRI)
+      deduceImm(MRI);
+  }
   ShapeT()
       : Row(nullptr), Col(nullptr), RowImm(InvalidImmShape),
         ColImm(InvalidImmShape) {}
+  // TODO: We need to extern cmp operator for muti-shapes if
----------------
fzou1 wrote:

muti->multi

https://github.com/llvm/llvm-project/pull/113532


More information about the cfe-commits mailing list