[llvm] [SandboxVec][LoadStoreVec] Dispatch runOnRegion on seed kind (PR #215944)

Anshil Gandhi via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 21:46:00 PDT 2026


================
@@ -35,14 +36,35 @@ class LLVM_ABI LoadStoreVec final : public RegionPass {
   std::optional<Type *> canVectorize(ArrayRef<Instruction *> Bndl,
                                      Scheduler &Sched);
 
-  void tryEraseDeadInstrs(ArrayRef<Instruction *> Stores,
-                          ArrayRef<Value *> Operands);
+  /// Erases each instruction in \p Bndl -- the store or load bundle just
+  /// replaced by a new vector value -- that has no remaining uses, plus each
+  /// load in \p MaybeDeadOperands that likewise has no remaining uses (an
+  /// operand isn't necessarily single-use, e.g. a packed operand, see
+  /// packOperands()). A store in \p Bndl is always dead, since it never
+  /// produced a value in the first place; a load in \p Bndl (a top-level
+  /// seed load) is only erased once it truly has no uses left, which
+  /// vectorizeLoads() guarantees by unpacking every use first. Also cleans
+  /// up any pointer-operand GEP that becomes dead as a result.
+  void eraseDeadAfterVectorize(ArrayRef<Instruction *> Bndl,
----------------
gandhi56 wrote:

I moved `BundleVec::collectPotentiallyDeadInstrs()` and `BundleVec::tryEraseDeadInstrs()` to VecUtils. If it doesn't suffice, I can create a new PR to create the class. All tests are passing for now.

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


More information about the llvm-commits mailing list