[mlir] Don't call llvm::raw_string_ostream::flush() (NFC)
Don't call raw_string_ostream::flush(), which is essentially a no-op. As specified in the docs, raw_string_ostream is always unbuffered. ( 65b13610a5226b84889b923bae884ba395ad084d for further reference )
This commit is contained in:
parent
5a68ac8ba7
commit
123e8c735d
@ -495,7 +495,6 @@ static std::string buildMmaSparseAsmConstraintString(unsigned matASize,
|
|||||||
// The final operand is for the sparsity metadata.
|
// The final operand is for the sparsity metadata.
|
||||||
// The sparsity selector appears as direct literal.
|
// The sparsity selector appears as direct literal.
|
||||||
ss << "r";
|
ss << "r";
|
||||||
ss.flush();
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -535,7 +534,6 @@ static std::string buildMmaSparseAsmString(
|
|||||||
ss << "$" << asmArgIdx++ << ",";
|
ss << "$" << asmArgIdx++ << ",";
|
||||||
assert(metaDataSelector <= 1);
|
assert(metaDataSelector <= 1);
|
||||||
ss << "0x" << metaDataSelector << ";";
|
ss << "0x" << metaDataSelector << ";";
|
||||||
ss.flush();
|
|
||||||
return asmStr;
|
return asmStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,14 +99,12 @@ void PtxBuilder::insertValue(Value v, PTXRegisterMod itype) {
|
|||||||
} else {
|
} else {
|
||||||
ss << getModifier() << getRegisterType(t) << ",";
|
ss << getModifier() << getRegisterType(t) << ",";
|
||||||
}
|
}
|
||||||
ss.flush();
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Handle Scalars
|
// Handle Scalars
|
||||||
addValue(v);
|
addValue(v);
|
||||||
ss << getModifier() << getRegisterType(v) << ",";
|
ss << getModifier() << getRegisterType(v) << ",";
|
||||||
ss.flush();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVM::InlineAsmOp PtxBuilder::build() {
|
LLVM::InlineAsmOp PtxBuilder::build() {
|
||||||
|
@ -111,7 +111,6 @@ void transform::TransformDialect::reportDuplicateTypeRegistration(
|
|||||||
llvm::raw_string_ostream msg(buffer);
|
llvm::raw_string_ostream msg(buffer);
|
||||||
msg << "extensible dialect type '" << mnemonic
|
msg << "extensible dialect type '" << mnemonic
|
||||||
<< "' is already registered with a different implementation";
|
<< "' is already registered with a different implementation";
|
||||||
msg.flush();
|
|
||||||
llvm::report_fatal_error(StringRef(buffer));
|
llvm::report_fatal_error(StringRef(buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +120,6 @@ void transform::TransformDialect::reportDuplicateOpRegistration(
|
|||||||
llvm::raw_string_ostream msg(buffer);
|
llvm::raw_string_ostream msg(buffer);
|
||||||
msg << "extensible dialect operation '" << opName
|
msg << "extensible dialect operation '" << opName
|
||||||
<< "' is already registered with a mismatching TypeID";
|
<< "' is already registered with a mismatching TypeID";
|
||||||
msg.flush();
|
|
||||||
llvm::report_fatal_error(StringRef(buffer));
|
llvm::report_fatal_error(StringRef(buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,6 @@ static std::string makeString(T array, bool breakline = false) {
|
|||||||
os << "\n\t\t";
|
os << "\n\t\t";
|
||||||
}
|
}
|
||||||
os << array.back() << "]";
|
os << array.back() << "]";
|
||||||
os.flush();
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,6 @@ translateDataLayout(DataLayoutSpecInterface attribute,
|
|||||||
bool isLittleEndian =
|
bool isLittleEndian =
|
||||||
value.getValue() == DLTIDialect::kDataLayoutEndiannessLittle;
|
value.getValue() == DLTIDialect::kDataLayoutEndiannessLittle;
|
||||||
layoutStream << "-" << (isLittleEndian ? "e" : "E");
|
layoutStream << "-" << (isLittleEndian ? "e" : "E");
|
||||||
layoutStream.flush();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (key.getValue() == DLTIDialect::kDataLayoutProgramMemorySpaceKey) {
|
if (key.getValue() == DLTIDialect::kDataLayoutProgramMemorySpaceKey) {
|
||||||
@ -205,7 +204,6 @@ translateDataLayout(DataLayoutSpecInterface attribute,
|
|||||||
if (space == 0)
|
if (space == 0)
|
||||||
continue;
|
continue;
|
||||||
layoutStream << "-P" << space;
|
layoutStream << "-P" << space;
|
||||||
layoutStream.flush();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (key.getValue() == DLTIDialect::kDataLayoutGlobalMemorySpaceKey) {
|
if (key.getValue() == DLTIDialect::kDataLayoutGlobalMemorySpaceKey) {
|
||||||
@ -215,7 +213,6 @@ translateDataLayout(DataLayoutSpecInterface attribute,
|
|||||||
if (space == 0)
|
if (space == 0)
|
||||||
continue;
|
continue;
|
||||||
layoutStream << "-G" << space;
|
layoutStream << "-G" << space;
|
||||||
layoutStream.flush();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (key.getValue() == DLTIDialect::kDataLayoutAllocaMemorySpaceKey) {
|
if (key.getValue() == DLTIDialect::kDataLayoutAllocaMemorySpaceKey) {
|
||||||
@ -225,7 +222,6 @@ translateDataLayout(DataLayoutSpecInterface attribute,
|
|||||||
if (space == 0)
|
if (space == 0)
|
||||||
continue;
|
continue;
|
||||||
layoutStream << "-A" << space;
|
layoutStream << "-A" << space;
|
||||||
layoutStream.flush();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (key.getValue() == DLTIDialect::kDataLayoutStackAlignmentKey) {
|
if (key.getValue() == DLTIDialect::kDataLayoutStackAlignmentKey) {
|
||||||
@ -235,7 +231,6 @@ translateDataLayout(DataLayoutSpecInterface attribute,
|
|||||||
if (alignment == 0)
|
if (alignment == 0)
|
||||||
continue;
|
continue;
|
||||||
layoutStream << "-S" << alignment;
|
layoutStream << "-S" << alignment;
|
||||||
layoutStream.flush();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
emitError(*loc) << "unsupported data layout key " << key;
|
emitError(*loc) << "unsupported data layout key " << key;
|
||||||
@ -293,7 +288,6 @@ translateDataLayout(DataLayoutSpecInterface attribute,
|
|||||||
if (failed(result))
|
if (failed(result))
|
||||||
return failure();
|
return failure();
|
||||||
}
|
}
|
||||||
layoutStream.flush();
|
|
||||||
StringRef layoutSpec(llvmDataLayout);
|
StringRef layoutSpec(llvmDataLayout);
|
||||||
if (layoutSpec.starts_with("-"))
|
if (layoutSpec.starts_with("-"))
|
||||||
layoutSpec = layoutSpec.drop_front();
|
layoutSpec = layoutSpec.drop_front();
|
||||||
|
@ -1411,7 +1411,6 @@ void OpEmitter::genPropertiesSupport() {
|
|||||||
// Backward compat for now, TODO: Remove at some point.
|
// Backward compat for now, TODO: Remove at some point.
|
||||||
os << " if (!attr) attr = dict.get(\"result_segment_sizes\");";
|
os << " if (!attr) attr = dict.get(\"result_segment_sizes\");";
|
||||||
}
|
}
|
||||||
os.flush();
|
|
||||||
|
|
||||||
setPropMethod << "{\n"
|
setPropMethod << "{\n"
|
||||||
<< formatv(propFromAttrFmt,
|
<< formatv(propFromAttrFmt,
|
||||||
@ -1445,7 +1444,6 @@ void OpEmitter::genPropertiesSupport() {
|
|||||||
// Backward compat for now
|
// Backward compat for now
|
||||||
os << " if (!attr) attr = dict.get(\"result_segment_sizes\");";
|
os << " if (!attr) attr = dict.get(\"result_segment_sizes\");";
|
||||||
}
|
}
|
||||||
os.flush();
|
|
||||||
|
|
||||||
setPropMethod << formatv(R"decl(
|
setPropMethod << formatv(R"decl(
|
||||||
{{
|
{{
|
||||||
@ -4188,10 +4186,8 @@ OpOperandAdaptorEmitter::OpOperandAdaptorEmitter(
|
|||||||
" bool operator!=(const Properties &rhs) const {\n"
|
" bool operator!=(const Properties &rhs) const {\n"
|
||||||
" return !(*this == rhs);\n"
|
" return !(*this == rhs);\n"
|
||||||
" }\n";
|
" }\n";
|
||||||
comparatorOs.flush();
|
|
||||||
os << comparator;
|
os << comparator;
|
||||||
os << " };\n";
|
os << " };\n";
|
||||||
os.flush();
|
|
||||||
|
|
||||||
genericAdaptorBase.declare<ExtraClassDeclaration>(std::move(declarations));
|
genericAdaptorBase.declare<ExtraClassDeclaration>(std::move(declarations));
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ TEST(FormatTest, SingleLine) {
|
|||||||
llvm::raw_string_ostream os(str);
|
llvm::raw_string_ostream os(str);
|
||||||
raw_indented_ostream ros(os);
|
raw_indented_ostream ros(os);
|
||||||
ros << 10;
|
ros << 10;
|
||||||
ros.flush();
|
|
||||||
EXPECT_THAT(str, StrEq("10"));
|
EXPECT_THAT(str, StrEq("10"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,7 +29,6 @@ TEST(FormatTest, SimpleMultiLine) {
|
|||||||
ros << "\n";
|
ros << "\n";
|
||||||
ros << "c";
|
ros << "c";
|
||||||
ros << "\n";
|
ros << "\n";
|
||||||
ros.flush();
|
|
||||||
EXPECT_THAT(str, StrEq("ab\nc\n"));
|
EXPECT_THAT(str, StrEq("ab\nc\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +41,6 @@ TEST(FormatTest, SimpleMultiLineIndent) {
|
|||||||
ros << "\n";
|
ros << "\n";
|
||||||
ros << "c";
|
ros << "c";
|
||||||
ros << "\n";
|
ros << "\n";
|
||||||
ros.flush();
|
|
||||||
EXPECT_THAT(str, StrEq(" a b\n c\n"));
|
EXPECT_THAT(str, StrEq(" a b\n c\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +59,6 @@ TEST(FormatTest, SingleRegion) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ros << "after";
|
ros << "after";
|
||||||
ros.flush();
|
|
||||||
const auto *expected =
|
const auto *expected =
|
||||||
R"(before
|
R"(before
|
||||||
inside 10
|
inside 10
|
||||||
@ -79,7 +75,6 @@ after)";
|
|||||||
ros.scope().os << "inside " << 10 << "\n two\n";
|
ros.scope().os << "inside " << 10 << "\n two\n";
|
||||||
ros.scope().os.scope("{\n", "\n}\n").os << "inner inner";
|
ros.scope().os.scope("{\n", "\n}\n").os << "inner inner";
|
||||||
ros << "after";
|
ros << "after";
|
||||||
ros.flush();
|
|
||||||
EXPECT_THAT(os.str(), StrEq(expected));
|
EXPECT_THAT(os.str(), StrEq(expected));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +94,6 @@ TEST(FormatTest, Reindent) {
|
|||||||
|
|
||||||
)";
|
)";
|
||||||
ros.printReindented(desc);
|
ros.printReindented(desc);
|
||||||
ros.flush();
|
|
||||||
const auto *expected =
|
const auto *expected =
|
||||||
R"(First line
|
R"(First line
|
||||||
second line
|
second line
|
||||||
@ -120,7 +114,6 @@ TEST(FormatTest, ReindentLineEndings) {
|
|||||||
const auto *desc =
|
const auto *desc =
|
||||||
"\r\n\r\n\r\n First line\r\n second line";
|
"\r\n\r\n\r\n First line\r\n second line";
|
||||||
ros.printReindented(desc);
|
ros.printReindented(desc);
|
||||||
ros.flush();
|
|
||||||
const auto *expected = "First line\r\n second line";
|
const auto *expected = "First line\r\n second line";
|
||||||
EXPECT_THAT(str, StrEq(expected));
|
EXPECT_THAT(str, StrEq(expected));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user