aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/DecoderEmitter.cpp
diff options
context:
space:
mode:
authorSergei Barannikov <barannikov88@gmail.com>2025-08-12 23:21:01 +0300
committerGitHub <noreply@github.com>2025-08-12 20:21:01 +0000
commit1ffc38ca4920e6fdf0e640d09f50f397d6831a09 (patch)
treea16526100ae2cbcd154ae4ca85f7707d013a9f5d /llvm/utils/TableGen/DecoderEmitter.cpp
parentb26a7f8e649039bda7acfe616e3b53ef1680f1ac (diff)
downloadllvm-1ffc38ca4920e6fdf0e640d09f50f397d6831a09.zip
llvm-1ffc38ca4920e6fdf0e640d09f50f397d6831a09.tar.gz
llvm-1ffc38ca4920e6fdf0e640d09f50f397d6831a09.tar.bz2
[TableGen][DecoderEmitter] Remove unused variables (NFC) (#153262)
Diffstat (limited to 'llvm/utils/TableGen/DecoderEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/DecoderEmitter.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index 9cc26c3..f64467a 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -385,7 +385,6 @@ protected:
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 @@ protected:
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 @@ protected:
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 @@ public:
///////////////////////////
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;
}
}