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

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 14:57:03 PDT 2026


================
@@ -200,19 +191,84 @@ bool LoadStoreVec::vectorizeStores(ArrayRef<Instruction *> Bndl, Region &Rgn,
   auto StWhereIt = std::next(VecUtils::getLowest(Bndl)->getIterator());
   StoreInst::create(VecOp, StPtr, StAlign, StWhereIt, Ctx);
 
-  tryEraseDeadInstrs(Bndl, Operands);
+  DenseSet<Instruction *> DeadInstrCandidates;
+  VecUtils::collectPotentiallyDeadInstrs(Bndl, DeadInstrCandidates);
+  if (AllLoads)
+    VecUtils::collectPotentiallyDeadInstrs(ArrayRef<Value *>(Operands),
+                                           DeadInstrCandidates);
+  VecUtils::tryEraseDeadInstrs(DeadInstrCandidates);
 
   return acceptOrRevert();
 }
 
+Value *LoadStoreVec::vectorizeLoads(ArrayRef<Instruction *> Bndl, Region &Rgn,
+                                    Scheduler &Sched, const Analyses &A,
+                                    bool OwnTransaction) {
+  Function &F = *Bndl[0]->getParent()->getParent();
+  auto &Ctx = F.getContext();
+  if (OwnTransaction)
+    saveIR(Rgn);
+
+  SmallVector<Value *, 8> Operands(Bndl.begin(), Bndl.end());
----------------
vporpo wrote:

This naming is very confusing, shouldn't `Operands` be something like `Loads` ?
Why do we even need this copy in the first place ?

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


More information about the llvm-commits mailing list