Repository navigation
[TableGen][DecoderEmitter] Remove unused variables (NFC) - #153262
Merged
s-barannikov merged 1 commit intoAug 12, 2025
Merged
Conversation
s-barannikov
enabled auto-merge (squash)
August 12, 2025 19:50
Member
|
@llvm/pr-subscribers-tablegen Author: Sergei Barannikov (s-barannikov) Changes1 Files Affected:
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index 9cc26c3cb3cae..f64467a0f35e6 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -385,7 +385,6 @@ class Filter {
const FilterChooser &Owner; // FilterChooser who owns this filter
unsigned StartBit; // the starting bit position
unsigned NumBits; // number of bits to filter
- bool Mixed; // a mixed region contains both set and unset bits
// Map of well-known segment value to the set of uid's with that value.
std::map<uint64_t, std::vector<EncodingIDAndOpcode>> FilteredInstructions;
@@ -404,8 +403,7 @@ class Filter {
public:
Filter(Filter &&f);
- Filter(const FilterChooser &owner, unsigned startBit, unsigned numBits,
- bool mixed);
+ Filter(const FilterChooser &owner, unsigned startBit, unsigned numBits);
~Filter() = default;
@@ -614,7 +612,7 @@ class FilterChooser {
unsigned Opc) const;
// Assign a single filter and run with it.
- void runSingleFilter(unsigned startBit, unsigned numBit, bool mixed);
+ void runSingleFilter(unsigned startBit, unsigned numBit);
// reportRegion is a helper function for filterProcessor to mark a region as
// eligible for use as a filter region.
@@ -646,15 +644,14 @@ class FilterChooser {
///////////////////////////
Filter::Filter(Filter &&f)
- : Owner(f.Owner), StartBit(f.StartBit), NumBits(f.NumBits), Mixed(f.Mixed),
+ : Owner(f.Owner), StartBit(f.StartBit), NumBits(f.NumBits),
FilteredInstructions(std::move(f.FilteredInstructions)),
VariableInstructions(std::move(f.VariableInstructions)),
FilterChooserMap(std::move(f.FilterChooserMap)),
NumFiltered(f.NumFiltered), LastOpcFiltered(f.LastOpcFiltered) {}
-Filter::Filter(const FilterChooser &owner, unsigned startBit, unsigned numBits,
- bool mixed)
- : Owner(owner), StartBit(startBit), NumBits(numBits), Mixed(mixed) {
+Filter::Filter(const FilterChooser &owner, unsigned startBit, unsigned numBits)
+ : Owner(owner), StartBit(startBit), NumBits(numBits) {
assert(StartBit + NumBits - 1 < Owner.BitWidth);
NumFiltered = 0;
@@ -1537,10 +1534,9 @@ void FilterChooser::emitSingletonTableEntry(DecoderTableInfo &TableInfo,
// Assign a single filter and run with it. Top level API client can initialize
// with a single filter to start the filtering process.
-void FilterChooser::runSingleFilter(unsigned startBit, unsigned numBit,
- bool mixed) {
+void FilterChooser::runSingleFilter(unsigned startBit, unsigned numBit) {
Filters.clear();
- Filters.emplace_back(*this, startBit, numBit, true);
+ Filters.emplace_back(*this, startBit, numBit);
BestIndex = 0; // Sole Filter instance to choose from.
bestFilter().recurse();
}
@@ -1549,10 +1545,8 @@ void FilterChooser::runSingleFilter(unsigned startBit, unsigned numBit,
// eligible for use as a filter region.
void FilterChooser::reportRegion(bitAttr_t RA, unsigned StartBit,
unsigned BitIndex, bool AllowMixed) {
- if (RA == ATTR_MIXED && AllowMixed)
- Filters.emplace_back(*this, StartBit, BitIndex - StartBit, true);
- else if (RA == ATTR_ALL_SET && !AllowMixed)
- Filters.emplace_back(*this, StartBit, BitIndex - StartBit, false);
+ if (AllowMixed ? RA == ATTR_MIXED : RA == ATTR_ALL_SET)
+ Filters.emplace_back(*this, StartBit, BitIndex - StartBit);
}
// FilterProcessor scans the well-known encoding bits of the instructions and
@@ -1583,7 +1577,7 @@ bool FilterChooser::filterProcessor(bool AllowMixed, bool Greedy) {
// Look for islands of undecoded bits of any instruction.
if (getIslands(Islands, Insn) > 0) {
// Found an instruction with island(s). Now just assign a filter.
- runSingleFilter(Islands[0].StartBit, Islands[0].NumBits, true);
+ runSingleFilter(Islands[0].StartBit, Islands[0].NumBits);
return true;
}
}
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.