[llvm] LSV: forbid load-cycles when vectorizing; fix bug (PR #104815)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 20 12:11:23 PDT 2024
================
@@ -996,10 +996,32 @@ bool Vectorizer::isSafeToMove(
LLVM_DEBUG(dbgs() << "LSV: isSafeToMove(" << *ChainElem << " -> "
<< *ChainBegin << ")\n");
- assert(isa<LoadInst>(ChainElem) == IsLoadChain);
+ assert(isa<LoadInst>(ChainElem) == IsLoadChain &&
+ isa<LoadInst>(ChainBegin) == IsLoadChain);
+
if (ChainElem == ChainBegin)
return true;
+ if constexpr (IsLoadChain) {
----------------
arsenm wrote:
Would the previous SCEV check prevent reaching here in some subset of situations?
https://github.com/llvm/llvm-project/pull/104815
More information about the llvm-commits
mailing list