@@ -398,9 +398,6 @@ class Filter {
398398 // Number of instructions which fall under FilteredInstructions category.
399399 unsigned NumFiltered;
400400
401- // Keeps track of the last opcode in the filtered bucket.
402- EncodingIDAndOpcode LastOpcFiltered;
403-
404401public:
405402 Filter (Filter &&f);
406403 Filter (const FilterChooser &owner, unsigned startBit, unsigned numBits);
@@ -411,7 +408,7 @@ class Filter {
411408
412409 EncodingIDAndOpcode getSingletonOpc () const {
413410 assert (NumFiltered == 1 );
414- return LastOpcFiltered ;
411+ return FilteredInstructions. begin ()-> second . front () ;
415412 }
416413
417414 // Return the filter chooser for the group of instructions without constant
@@ -650,14 +647,13 @@ Filter::Filter(Filter &&f)
650647 FilteredInstructions(std::move(f.FilteredInstructions)),
651648 VariableInstructions(std::move(f.VariableInstructions)),
652649 FilterChooserMap(std::move(f.FilterChooserMap)),
653- NumFiltered(f.NumFiltered), LastOpcFiltered(f.LastOpcFiltered) {}
650+ NumFiltered(f.NumFiltered) {}
654651
655652Filter::Filter (const FilterChooser &owner, unsigned startBit, unsigned numBits)
656653 : Owner(owner), StartBit(startBit), NumBits(numBits) {
657654 assert (StartBit + NumBits - 1 < Owner.BitWidth );
658655
659656 NumFiltered = 0 ;
660- LastOpcFiltered = {0 , 0 };
661657
662658 for (const auto &OpcPair : Owner.Opcodes ) {
663659 // Populates the insn given the uid.
@@ -669,8 +665,7 @@ Filter::Filter(const FilterChooser &owner, unsigned startBit, unsigned numBits)
669665 if (Ok) {
670666 // The encoding bits are well-known. Lets add the uid of the
671667 // instruction into the bucket keyed off the constant field value.
672- LastOpcFiltered = OpcPair;
673- FilteredInstructions[Field].push_back (LastOpcFiltered);
668+ FilteredInstructions[Field].push_back (OpcPair);
674669 ++NumFiltered;
675670 } else {
676671 // Some of the encoding bit(s) are unspecified. This contributes to
0 commit comments