[llvm] 0d524bc - [llvm-mca] Use llvm::erase_if (NFC) (#96029)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 05:59:45 PDT 2024


Author: Kazu Hirata
Date: 2024-06-19T05:59:41-07:00
New Revision: 0d524bc45ddaa2bd94c28c8935e53153827f2374

URL: https://github.com/llvm/llvm-project/commit/0d524bc45ddaa2bd94c28c8935e53153827f2374
DIFF: https://github.com/llvm/llvm-project/commit/0d524bc45ddaa2bd94c28c8935e53153827f2374.diff

LOG: [llvm-mca] Use llvm::erase_if (NFC) (#96029)

Added: 
    

Modified: 
    llvm/tools/llvm-mca/CodeRegion.h

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-mca/CodeRegion.h b/llvm/tools/llvm-mca/CodeRegion.h
index 5a2e8baa1f3e7..ef8804f1b494c 100644
--- a/llvm/tools/llvm-mca/CodeRegion.h
+++ b/llvm/tools/llvm-mca/CodeRegion.h
@@ -104,11 +104,9 @@ class CodeRegion {
   dropInstructions(const llvm::SmallPtrSetImpl<const llvm::MCInst *> &Insts) {
     if (Insts.empty())
       return Instructions;
-    Instructions.erase(std::remove_if(Instructions.begin(), Instructions.end(),
-                                      [&Insts](const llvm::MCInst &Inst) {
-                                        return Insts.contains(&Inst);
-                                      }),
-                       Instructions.end());
+    llvm::erase_if(Instructions, [&Insts](const llvm::MCInst &Inst) {
+      return Insts.contains(&Inst);
+    });
     return Instructions;
   }
 


        


More information about the llvm-commits mailing list