[llvm] 8f9d73f - [NFC][AArch64] Minor refactor of AArch64InstPrinter::printMatrixTileList

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 01:52:31 PDT 2022


Author: David Sherwood
Date: 2022-06-15T09:52:24+01:00
New Revision: 8f9d73fbd6a0ca48abf6543566e7faefb4904836

URL: https://github.com/llvm/llvm-project/commit/8f9d73fbd6a0ca48abf6543566e7faefb4904836
DIFF: https://github.com/llvm/llvm-project/commit/8f9d73fbd6a0ca48abf6543566e7faefb4904836.diff

LOG: [NFC][AArch64] Minor refactor of AArch64InstPrinter::printMatrixTileList

We can remove the MatrixZADRegisterTable table of tile registers and
just calculate the register index directly.

Differential Revision: https://reviews.llvm.org/D127757

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
index ee0870d9ef7ae..5d2ba7ef02c02 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
@@ -1340,11 +1340,6 @@ void AArch64InstPrinter::printGPRSeqPairsClassOperand(const MCInst *MI,
   O << getRegisterName(Even) << ", " << getRegisterName(Odd);
 }
 
-static const unsigned MatrixZADRegisterTable[] = {
-  AArch64::ZAD0, AArch64::ZAD1, AArch64::ZAD2, AArch64::ZAD3,
-  AArch64::ZAD4, AArch64::ZAD5, AArch64::ZAD6, AArch64::ZAD7
-};
-
 void AArch64InstPrinter::printMatrixTileList(const MCInst *MI, unsigned OpNum,
                                              const MCSubtargetInfo &STI,
                                              raw_ostream &O) {
@@ -1362,7 +1357,7 @@ void AArch64InstPrinter::printMatrixTileList(const MCInst *MI, unsigned OpNum,
     unsigned Reg = RegMask & (1 << I);
     if (Reg == 0)
       continue;
-    O << getRegisterName(MatrixZADRegisterTable[I]);
+    O << getRegisterName(AArch64::ZAD0 + I);
     if (Printed + 1 != NumRegs)
       O << ", ";
     ++Printed;


        


More information about the llvm-commits mailing list