[llvm] [SandboxVectorizer] Use llvm::erase (NFC) (PR #134018)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 1 19:46:46 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/134018
None
>From cbc395a8d5a5889e391caefbb0cd1cd57f0fe3dd Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 30 Mar 2025 00:52:02 -0700
Subject: [PATCH] [SandboxVectorizer] Use llvm::erase (NFC)
---
.../llvm/Transforms/Vectorize/SandboxVectorizer/Scheduler.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
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