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

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 18 23:41:13 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-tools-llvm-mca

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/96029.diff


1 Files Affected:

- (modified) llvm/tools/llvm-mca/CodeRegion.h (+3-5) 


``````````diff
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;
   }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/96029


More information about the llvm-commits mailing list