[llvm] [SandboxVec][LoadStoreVec] Vectorize load seed chains (PR #215944)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 3 09:11:05 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,
----------------
vporpo wrote:

Given that we have separate "collect" and "erase" phases operating on the same DeadInstrCandidates, I think it would be better to have a class for this owning the DeadInstrCandidates vector. Ideally this should be a separate NFC PR before this one.

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


More information about the llvm-commits mailing list