[Mlir-commits] [mlir] 6461a82 - [Transforms] Use llvm::erase_if (NFC)

Kazu Hirata llvmlistbot at llvm.org
Fri Oct 20 00:09:02 PDT 2023


Author: Kazu Hirata
Date: 2023-10-20T00:08:56-07:00
New Revision: 6461a824e4b27d16243642e847ac97ede01d4f9f

URL: https://github.com/llvm/llvm-project/commit/6461a824e4b27d16243642e847ac97ede01d4f9f
DIFF: https://github.com/llvm/llvm-project/commit/6461a824e4b27d16243642e847ac97ede01d4f9f.diff

LOG: [Transforms] Use llvm::erase_if (NFC)

Added: 
    

Modified: 
    mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
index 378dd9128839d7f..67a78832ef30422 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
@@ -478,9 +478,7 @@ class SparseInsertGenerator
       std::replace_if(
           lvlType.begin(), lvlType.end(),
           [](char c) { return c == '(' || c == ','; }, '_');
-      lvlType.erase(std::remove_if(lvlType.begin(), lvlType.end(),
-                                   [](char c) { return c == ')' || c == ' '; }),
-                    lvlType.end());
+      llvm::erase_if(lvlType, [](char c) { return c == ')' || c == ' '; });
       nameOstream << lvlType << "_";
     }
     // Static dim sizes are used in the generated code while dynamic sizes are


        


More information about the Mlir-commits mailing list