Skip to content

Commit 8e2060b

Browse files
authored
[X86][TableGen] Remove unnecessary use of formatted_raw_ostream. NFC (#89343)
This code used to use the PadToColumn feature of formatted_raw_ostream, but no longer does. formatted_raw_ostream is slower than regular raw_ostream because it has to keep track of the number of character since the last new line character.
1 parent 016ce9e commit 8e2060b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/utils/TableGen/X86FoldTablesEmitter.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "Common/CodeGenTarget.h"
1616
#include "X86RecognizableInstr.h"
1717
#include "llvm/ADT/StringSwitch.h"
18-
#include "llvm/Support/FormattedStream.h"
1918
#include "llvm/Support/X86FoldTablesUtils.h"
2019
#include "llvm/TableGen/Record.h"
2120
#include "llvm/TableGen/TableGenBackend.h"
@@ -95,7 +94,7 @@ class X86FoldTablesEmitter {
9594
const CodeGenInstruction *MemInst)
9695
: RegInst(RegInst), MemInst(MemInst) {}
9796

98-
void print(formatted_raw_ostream &OS) const {
97+
void print(raw_ostream &OS) const {
9998
OS.indent(2);
10099
OS << "{X86::" << RegInst->TheDef->getName() << ", ";
101100
OS << "X86::" << MemInst->TheDef->getName() << ", ";
@@ -222,7 +221,7 @@ class X86FoldTablesEmitter {
222221
// Print the given table as a static const C++ array of type
223222
// X86FoldTableEntry.
224223
void printTable(const FoldTable &Table, StringRef TableName,
225-
formatted_raw_ostream &OS) {
224+
raw_ostream &OS) {
226225
OS << "static const X86FoldTableEntry " << TableName << "[] = {\n";
227226

228227
for (auto &E : Table)
@@ -619,9 +618,7 @@ void X86FoldTablesEmitter::updateTables(const CodeGenInstruction *RegInst,
619618
}
620619
}
621620

622-
void X86FoldTablesEmitter::run(raw_ostream &O) {
623-
formatted_raw_ostream OS(O);
624-
621+
void X86FoldTablesEmitter::run(raw_ostream &OS) {
625622
// Holds all memory instructions
626623
std::vector<const CodeGenInstruction *> MemInsts;
627624
// Holds all register instructions - divided according to opcode.

0 commit comments

Comments
 (0)