@@ -385,7 +385,6 @@ class Filter {
385385 const FilterChooser &Owner; // FilterChooser who owns this filter
386386 unsigned StartBit; // the starting bit position
387387 unsigned NumBits; // number of bits to filter
388- bool Mixed; // a mixed region contains both set and unset bits
389388
390389 // Map of well-known segment value to the set of uid's with that value.
391390 std::map<uint64_t , std::vector<EncodingIDAndOpcode>> FilteredInstructions;
@@ -404,8 +403,7 @@ class Filter {
404403
405404public:
406405 Filter (Filter &&f);
407- Filter (const FilterChooser &owner, unsigned startBit, unsigned numBits,
408- bool mixed);
406+ Filter (const FilterChooser &owner, unsigned startBit, unsigned numBits);
409407
410408 ~Filter () = default ;
411409
@@ -614,7 +612,7 @@ class FilterChooser {
614612 unsigned Opc) const ;
615613
616614 // Assign a single filter and run with it.
617- void runSingleFilter (unsigned startBit, unsigned numBit, bool mixed );
615+ void runSingleFilter (unsigned startBit, unsigned numBit);
618616
619617 // reportRegion is a helper function for filterProcessor to mark a region as
620618 // eligible for use as a filter region.
@@ -646,15 +644,14 @@ class FilterChooser {
646644// /////////////////////////
647645
648646Filter::Filter (Filter &&f)
649- : Owner(f.Owner), StartBit(f.StartBit), NumBits(f.NumBits), Mixed(f.Mixed),
647+ : Owner(f.Owner), StartBit(f.StartBit), NumBits(f.NumBits),
650648 FilteredInstructions(std::move(f.FilteredInstructions)),
651649 VariableInstructions(std::move(f.VariableInstructions)),
652650 FilterChooserMap(std::move(f.FilterChooserMap)),
653651 NumFiltered(f.NumFiltered), LastOpcFiltered(f.LastOpcFiltered) {}
654652
655- Filter::Filter (const FilterChooser &owner, unsigned startBit, unsigned numBits,
656- bool mixed)
657- : Owner(owner), StartBit(startBit), NumBits(numBits), Mixed(mixed) {
653+ Filter::Filter (const FilterChooser &owner, unsigned startBit, unsigned numBits)
654+ : Owner(owner), StartBit(startBit), NumBits(numBits) {
658655 assert (StartBit + NumBits - 1 < Owner.BitWidth );
659656
660657 NumFiltered = 0 ;
@@ -1537,10 +1534,9 @@ void FilterChooser::emitSingletonTableEntry(DecoderTableInfo &TableInfo,
15371534
15381535// Assign a single filter and run with it. Top level API client can initialize
15391536// with a single filter to start the filtering process.
1540- void FilterChooser::runSingleFilter (unsigned startBit, unsigned numBit,
1541- bool mixed) {
1537+ void FilterChooser::runSingleFilter (unsigned startBit, unsigned numBit) {
15421538 Filters.clear ();
1543- Filters.emplace_back (*this , startBit, numBit, true );
1539+ Filters.emplace_back (*this , startBit, numBit);
15441540 BestIndex = 0 ; // Sole Filter instance to choose from.
15451541 bestFilter ().recurse ();
15461542}
@@ -1549,10 +1545,8 @@ void FilterChooser::runSingleFilter(unsigned startBit, unsigned numBit,
15491545// eligible for use as a filter region.
15501546void FilterChooser::reportRegion (bitAttr_t RA, unsigned StartBit,
15511547 unsigned BitIndex, bool AllowMixed) {
1552- if (RA == ATTR_MIXED && AllowMixed)
1553- Filters.emplace_back (*this , StartBit, BitIndex - StartBit, true );
1554- else if (RA == ATTR_ALL_SET && !AllowMixed)
1555- Filters.emplace_back (*this , StartBit, BitIndex - StartBit, false );
1548+ if (AllowMixed ? RA == ATTR_MIXED : RA == ATTR_ALL_SET)
1549+ Filters.emplace_back (*this , StartBit, BitIndex - StartBit);
15561550}
15571551
15581552// FilterProcessor scans the well-known encoding bits of the instructions and
@@ -1583,7 +1577,7 @@ bool FilterChooser::filterProcessor(bool AllowMixed, bool Greedy) {
15831577 // Look for islands of undecoded bits of any instruction.
15841578 if (getIslands (Islands, Insn) > 0 ) {
15851579 // Found an instruction with island(s). Now just assign a filter.
1586- runSingleFilter (Islands[0 ].StartBit , Islands[0 ].NumBits , true );
1580+ runSingleFilter (Islands[0 ].StartBit , Islands[0 ].NumBits );
15871581 return true ;
15881582 }
15891583 }
0 commit comments