Skip to content

Commit 829f2f2

Browse files
committed
[VectorCombine] Mark function as changed if shuffle is created.
777d6b5 exposed a code path where a function is modified but not marked accordingly. Make sure we return true from foldShuffleFromReductions if only a shuffle has been inserted/replaced. Should fix https://lab.llvm.org/buildbot/#/builders/187/builds/7578.
1 parent ac76e4d commit 829f2f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2979,17 +2979,20 @@ bool VectorCombine::foldShuffleFromReductions(Instruction &I) {
29792979
<< "\n");
29802980
LLVM_DEBUG(dbgs() << " OldCost: " << OldCost << " vs NewCost: " << NewCost
29812981
<< "\n");
2982+
bool MadeChanges = false;
29822983
if (NewCost < OldCost) {
29832984
Builder.SetInsertPoint(Shuffle);
29842985
Value *NewShuffle = Builder.CreateShuffleVector(
29852986
Shuffle->getOperand(0), Shuffle->getOperand(1), ConcatMask);
29862987
LLVM_DEBUG(dbgs() << "Created new shuffle: " << *NewShuffle << "\n");
29872988
replaceValue(*Shuffle, *NewShuffle);
2989+
MadeChanges = true;
29882990
}
29892991

29902992
// See if we can re-use foldSelectShuffle, getting it to reduce the size of
29912993
// the shuffle into a nicer order, as it can ignore the order of the shuffles.
2992-
return foldSelectShuffle(*Shuffle, true);
2994+
MadeChanges |= foldSelectShuffle(*Shuffle, true);
2995+
return MadeChanges;
29932996
}
29942997

29952998
/// Determine if its more efficient to fold:

0 commit comments

Comments
 (0)