Skip to content

Commit 8aceb7a

Browse files
authored
[ValueTypes] Remove MVT::MAX_ALLOWED_VALUETYPE. NFC (#93654)
Despite the comment, this isn't used to size bit vectors or tables. That's done by VALUETYPE_SIZE. MAX_ALLOWED_VALUETYPE is only used by some static_asserts that compare it to VALUETYPE_SIZE. This patch removes it and most of the static_asserts. I left one where I compared VALUETYPE_SIZE to token which is the first type that isn't part of the VALUETYPE range. This isn't strictly needed, we'd probably catch duplication error from VTEmitter.cpp first.
1 parent 472184d commit 8aceb7a

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

llvm/include/llvm/CodeGenTypes/MachineValueType.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,10 @@ namespace llvm {
4545
#undef GET_VT_RANGES
4646

4747
VALUETYPE_SIZE = LAST_VALUETYPE + 1,
48-
49-
// This is the current maximum for LAST_VALUETYPE.
50-
// MVT::MAX_ALLOWED_VALUETYPE is used for asserts and to size bit vectors
51-
// This value must be a multiple of 32.
52-
MAX_ALLOWED_VALUETYPE = 224,
5348
};
5449

5550
static_assert(FIRST_VALUETYPE > 0);
56-
static_assert(LAST_VALUETYPE < MAX_ALLOWED_VALUETYPE);
51+
static_assert(LAST_VALUETYPE < token);
5752

5853
SimpleValueType SimpleTy = INVALID_SIMPLE_VALUE_TYPE;
5954

llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ class LLVM_LIBRARY_VISIBILITY DAGTypeLegalizer {
168168
explicit DAGTypeLegalizer(SelectionDAG &dag)
169169
: TLI(dag.getTargetLoweringInfo()), DAG(dag),
170170
ValueTypeActions(TLI.getValueTypeActions()) {
171-
static_assert(MVT::LAST_VALUETYPE <= MVT::MAX_ALLOWED_VALUETYPE,
172-
"Too many value types for ValueTypeActions to hold!");
173171
}
174172

175173
/// This is the main entry point for the type legalizer. This does a

llvm/lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,9 +1430,6 @@ TargetLoweringBase::findRepresentativeClass(const TargetRegisterInfo *TRI,
14301430
/// this allows us to compute derived properties we expose.
14311431
void TargetLoweringBase::computeRegisterProperties(
14321432
const TargetRegisterInfo *TRI) {
1433-
static_assert(MVT::VALUETYPE_SIZE <= MVT::MAX_ALLOWED_VALUETYPE,
1434-
"Too many value types for ValueTypeActions to hold!");
1435-
14361433
// Everything defaults to needing one register.
14371434
for (unsigned i = 0; i != MVT::VALUETYPE_SIZE; ++i) {
14381435
NumRegistersForVT[i] = 1;

0 commit comments

Comments
 (0)