================ @@ -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 ---------------- phoebewang wrote:
Done. https://github.com/llvm/llvm-project/pull/113532 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits