Skip to content

Commit 156c112

Browse files
authored
[TableGen][DecoderEmitter] Remove no longer needed MaxFilterWidth (NFC) (llvm#155382)
11c6158 made the variable redundant. Also remove `Target`, which is apparently unused.
1 parent 2ab4c28 commit 156c112

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

llvm/utils/TableGen/DecoderEmitter.cpp

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -483,12 +483,6 @@ class FilterChooser {
483483
// Links to the FilterChooser above us in the decoding tree.
484484
const FilterChooser *Parent;
485485

486-
/// Some targets (ARM) specify more encoding bits in Inst that Size allows.
487-
/// This field allows us to ignore the extra bits.
488-
unsigned MaxFilterWidth;
489-
490-
const CodeGenTarget &Target;
491-
492486
/// If the selected filter matches multiple encodings, then this is the
493487
/// starting position and the width of the filtered range.
494488
unsigned StartBit;
@@ -522,16 +516,12 @@ class FilterChooser {
522516
public:
523517
/// Constructs a top-level filter chooser.
524518
FilterChooser(ArrayRef<InstructionEncoding> Encodings,
525-
ArrayRef<unsigned> EncodingIDs, unsigned MaxFilterWidth,
526-
const CodeGenTarget &Target)
527-
: Encodings(Encodings), EncodingIDs(EncodingIDs), Parent(nullptr),
528-
MaxFilterWidth(MaxFilterWidth), Target(Target) {
519+
ArrayRef<unsigned> EncodingIDs)
520+
: Encodings(Encodings), EncodingIDs(EncodingIDs), Parent(nullptr) {
529521
// Sort encoding IDs once.
530522
stable_sort(this->EncodingIDs, LessEncodingIDByWidth(Encodings));
531523
// Filter width is the width of the smallest encoding.
532524
unsigned FilterWidth = Encodings[this->EncodingIDs.front()].getBitWidth();
533-
// Cap it as necessary.
534-
FilterWidth = std::min(FilterWidth, MaxFilterWidth);
535525
FilterBits = KnownBits(FilterWidth);
536526
doFilter();
537527
}
@@ -540,15 +530,12 @@ class FilterChooser {
540530
FilterChooser(ArrayRef<InstructionEncoding> Encodings,
541531
ArrayRef<unsigned> EncodingIDs, const KnownBits &FilterBits,
542532
const FilterChooser &Parent)
543-
: Encodings(Encodings), EncodingIDs(EncodingIDs), Parent(&Parent),
544-
MaxFilterWidth(Parent.MaxFilterWidth), Target(Parent.Target) {
533+
: Encodings(Encodings), EncodingIDs(EncodingIDs), Parent(&Parent) {
545534
// Inferior filter choosers are created from sorted array of encoding IDs.
546535
assert(is_sorted(EncodingIDs, LessEncodingIDByWidth(Encodings)));
547536
assert(!FilterBits.hasConflict() && "Broken filter");
548537
// Filter width is the width of the smallest encoding.
549538
unsigned FilterWidth = Encodings[EncodingIDs.front()].getBitWidth();
550-
// Cap it as necessary.
551-
FilterWidth = std::min(FilterWidth, MaxFilterWidth);
552539
this->FilterBits = FilterBits.anyext(FilterWidth);
553540
doFilter();
554541
}
@@ -2562,7 +2549,7 @@ namespace {
25622549
auto [DecoderNamespace, HwModeID, Size] = Key;
25632550
const unsigned BitWidth = IsVarLenInst ? MaxInstLen : 8 * Size;
25642551
// Emit the decoder for this (namespace, hwmode, width) combination.
2565-
FilterChooser FC(Encodings, EncodingIDs, BitWidth, Target);
2552+
FilterChooser FC(Encodings, EncodingIDs);
25662553

25672554
// The decode table is cleared for each top level decoder function. The
25682555
// predicates and decoders themselves, however, are shared across all

0 commit comments

Comments
 (0)