[llvm] [LSV] Insert casts to vectorize mismatched types (PR #134436)
Anshil Gandhi via llvm-commits
llvm-commits at lists.llvm.org
Mon May 5 07:19:58 PDT 2025
================
@@ -1495,7 +1629,7 @@ Vectorizer::collectEquivalenceClasses(BasicBlock::iterator Begin,
/*IsLoad=*/LI != nullptr}]
.emplace_back(&I);
}
-
+ insertCastsToMergeClasses(Ret);
----------------
gandhi56 wrote:
Theoretically, it may be possible. The necessary changes seem cumbersome to me, however. After collecting classes, LSV extracts chains from each class. These chains are split based on contiguity, alignment and MayAlias instructions, before vectorization. Merging chains after these splits would require careful handling of their instructions as `vectorizeChain` makes certain assumptions before determining the type of vectorized load/store.
I prefer to insert casts alongside `mergeEquivalenceClasses(..)` as `gatherChains` already understands what kinds of chains are handlable by `vectorizeChain`.
https://github.com/llvm/llvm-project/pull/134436
More information about the llvm-commits
mailing list