[llvm-branch-commits] [llvm] [SandboxVectorizer] Implement topdown/bottomup vectorizers in unison (PR #205249)
Anshil Gandhi via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jul 2 13:09:30 PDT 2026
================
@@ -288,6 +288,55 @@ Action *BottomUpVec::vectorizeRec(ArrayRef<Value *> Bndl,
const auto &LegalityRes = StopForDebug ? Legality.getForcedPackForDebugging()
: Legality.canVectorize(Bndl);
LLVM_DEBUG(dbgs() << DEBUG_PREFIX << "Legality: " << LegalityRes << "\n");
+
+ if (Direction == VecDirection::TopDown) {
+ auto ActionPtr = std::make_unique<Action>(&LegalityRes, Bndl,
+ ArrayRef<Value *>(), Depth);
+
+ if (LegalityRes.getSubclassID() == LegalityResultID::Widen)
+ IMaps->registerVector(Bndl, ActionPtr.get());
+
+ // Pre-order push so defs are before uses.
+ Action *Action = ActionPtr.get();
+ Actions.push_back(std::move(ActionPtr));
+
+ if (LegalityRes.getSubclassID() == LegalityResultID::Widen) {
+ // Find users of Bndl to recurse down.
+ // Group the first user of each element if they match.
+ SmallVector<Value *, 4> NextUserBndl;
+ bool CanFormUserBndl = true;
+ for (Value *V : Bndl) {
----------------
gandhi56 wrote:
Added unit tests in VecUtilsTest.cpp
https://github.com/llvm/llvm-project/pull/205249
More information about the llvm-branch-commits
mailing list