[llvm] [CodeGenTypes] Remove unused ElSz argument from generated GET_VT_VECATTR (PR #95258)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 07:54:19 PDT 2024


https://github.com/jayfoad created https://github.com/llvm/llvm-project/pull/95258

None

>From fe467d49f883cc18024a9eef1492eedf00e0561e Mon Sep 17 00:00:00 2001
From: Jay Foad <jay.foad at amd.com>
Date: Wed, 12 Jun 2024 15:52:13 +0100
Subject: [PATCH] [CodeGenTypes] Remove unused ElSz argument from generated
 GET_VT_VECATTR

---
 llvm/include/llvm/CodeGenTypes/MachineValueType.h | 8 ++++----
 llvm/utils/TableGen/VTEmitter.cpp                 | 5 ++---
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/llvm/include/llvm/CodeGenTypes/MachineValueType.h b/llvm/include/llvm/CodeGenTypes/MachineValueType.h
index e008503f734b9..4e5e63cfb45e9 100644
--- a/llvm/include/llvm/CodeGenTypes/MachineValueType.h
+++ b/llvm/include/llvm/CodeGenTypes/MachineValueType.h
@@ -256,7 +256,7 @@ namespace llvm {
       default:
         llvm_unreachable("Not a vector MVT!");
 
-#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy, ElSz)                              \
+#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy)                                    \
   case Ty:                                                                     \
     return ElTy;
 #include "llvm/CodeGen/GenVT.inc"
@@ -270,7 +270,7 @@ namespace llvm {
       default:
         llvm_unreachable("Not a vector MVT!");
 
-#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy, ElSz)                              \
+#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy)                                    \
   case Ty:                                                                     \
     return nElem;
 #include "llvm/CodeGen/GenVT.inc"
@@ -440,7 +440,7 @@ namespace llvm {
     }
 
     static MVT getVectorVT(MVT VT, unsigned NumElements) {
-#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy, ElSz)                              \
+#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy)                                    \
   if (!Sc && VT.SimpleTy == ElTy && NumElements == nElem)                      \
     return Ty;
 #include "llvm/CodeGen/GenVT.inc"
@@ -450,7 +450,7 @@ namespace llvm {
     }
 
     static MVT getScalableVectorVT(MVT VT, unsigned NumElements) {
-#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy, ElSz)                              \
+#define GET_VT_VECATTR(Ty, Sc, nElem, ElTy)                                    \
   if (Sc && VT.SimpleTy == ElTy && NumElements == nElem)                       \
     return Ty;
 #include "llvm/CodeGen/GenVT.inc"
diff --git a/llvm/utils/TableGen/VTEmitter.cpp b/llvm/utils/TableGen/VTEmitter.cpp
index 64b54ed134232..d9d3dc2f696cb 100644
--- a/llvm/utils/TableGen/VTEmitter.cpp
+++ b/llvm/utils/TableGen/VTEmitter.cpp
@@ -110,7 +110,7 @@ void VTEmitter::run(raw_ostream &OS) {
   }
   OS << "#endif\n\n";
 
-  OS << "#ifdef GET_VT_VECATTR // (Ty, Sc, nElem, ElTy, ElSz)\n";
+  OS << "#ifdef GET_VT_VECATTR // (Ty, Sc, nElem, ElTy)\n";
   for (const auto *VT : VTsByNumber) {
     if (!VT || !VT->getValueAsBit("isVector"))
       continue;
@@ -121,8 +121,7 @@ void VTEmitter::run(raw_ostream &OS) {
        << VT->getValueAsString("LLVMName") << ", "
        << VT->getValueAsBit("isScalable") << ", "
        << VT->getValueAsInt("nElem") << ", "
-       << ElTy->getName() << ", "
-       << ElTy->getValueAsInt("Size") << ")\n";
+       << ElTy->getName() << ")\n";
     // clang-format on
   }
   OS << "#endif\n\n";



More information about the llvm-commits mailing list