aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-05-19 15:20:46 -0700
committerGitHub <noreply@github.com>2024-05-19 15:20:46 -0700
commit2f52bbeb6f6f3b7abef19cb5297773d95aa0b434 (patch)
tree5a08f82131acc7f4b53189e2e3ba1031c97d9a9f
parent2d5e488c98225108aebfe4aa4acfe6ec1f234a37 (diff)
downloadllvm-2f52bbeb6f6f3b7abef19cb5297773d95aa0b434.zip
llvm-2f52bbeb6f6f3b7abef19cb5297773d95aa0b434.tar.gz
llvm-2f52bbeb6f6f3b7abef19cb5297773d95aa0b434.tar.bz2
[mlir] Use operator==(StringRef, StringRef) (NFC) (#92706)
-rw-r--r--mlir/lib/Dialect/SparseTensor/IR/Detail/LvlTypeParser.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/mlir/lib/Dialect/SparseTensor/IR/Detail/LvlTypeParser.cpp b/mlir/lib/Dialect/SparseTensor/IR/Detail/LvlTypeParser.cpp
index 39f5cf1..bb6c65a 100644
--- a/mlir/lib/Dialect/SparseTensor/IR/Detail/LvlTypeParser.cpp
+++ b/mlir/lib/Dialect/SparseTensor/IR/Detail/LvlTypeParser.cpp
@@ -37,7 +37,7 @@ FailureOr<uint64_t> LvlTypeParser::parseLvlType(AsmParser &parser) const {
uint64_t properties = 0;
SmallVector<unsigned> structured;
- if (base.compare("structured") == 0) {
+ if (base == "structured") {
ParseResult res = parser.parseCommaSeparatedList(
mlir::OpAsmParser::Delimiter::OptionalSquare,
[&]() -> ParseResult { return parseStructured(parser, &structured); },
@@ -60,18 +60,18 @@ FailureOr<uint64_t> LvlTypeParser::parseLvlType(AsmParser &parser) const {
FAILURE_IF_FAILED(res)
// Set the base bit for properties.
- if (base.compare("dense") == 0) {
+ if (base == "dense") {
properties |= static_cast<uint64_t>(LevelFormat::Dense);
- } else if (base.compare("batch") == 0) {
+ } else if (base == "batch") {
properties |= static_cast<uint64_t>(LevelFormat::Batch);
- } else if (base.compare("compressed") == 0) {
+ } else if (base == "compressed") {
properties |= static_cast<uint64_t>(LevelFormat::Compressed);
- } else if (base.compare("structured") == 0) {
+ } else if (base == "structured") {
properties |= static_cast<uint64_t>(LevelFormat::NOutOfM);
properties |= nToBits(structured[0]) | mToBits(structured[1]);
- } else if (base.compare("loose_compressed") == 0) {
+ } else if (base == "loose_compressed") {
properties |= static_cast<uint64_t>(LevelFormat::LooseCompressed);
- } else if (base.compare("singleton") == 0) {
+ } else if (base == "singleton") {
properties |= static_cast<uint64_t>(LevelFormat::Singleton);
} else {
parser.emitError(loc, "unknown level format: ") << base;