[llvm] cc10896 - [SandboxVectorizer] Use llvm::erase (NFC) (#134018)

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 1 21:59:00 PDT 2025


Author: Kazu Hirata
Date: 2025-04-01T21:58:57-07:00
New Revision: cc10896fa2cc4096387f5cff09c23ff22deabd97

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

LOG: [SandboxVectorizer] Use llvm::erase (NFC) (#134018)

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Scheduler.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Scheduler.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Scheduler.h
index 2af3c6d0ea517..681cf881bce0f 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Scheduler.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Scheduler.h
@@ -112,9 +112,7 @@ class SchedBundle {
   ContainerTy Nodes;
 
   /// Called by the DGNode destructor to avoid accessing freed memory.
-  void eraseFromBundle(DGNode *N) {
-    Nodes.erase(std::remove(Nodes.begin(), Nodes.end(), N), Nodes.end());
-  }
+  void eraseFromBundle(DGNode *N) { llvm::erase(Nodes, N); }
   friend void DGNode::setSchedBundle(SchedBundle &); // For eraseFromBunde().
   friend DGNode::~DGNode();                          // For eraseFromBundle().
 


        


More information about the llvm-commits mailing list