Skip to content

Commit 8c27278

Browse files
committed
Break loop with foldBitcastOfShuffle
1 parent 8ae9816 commit 8c27278

File tree

2 files changed

+73
-67
lines changed

2 files changed

+73
-67
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,6 +2499,12 @@ bool VectorCombine::foldShuffleOfCastops(Instruction &I) {
24992499

25002500
Instruction::CastOps Opcode = C0->getOpcode();
25012501

2502+
// If this is allowed, foldShuffleOfCastops can get stuck in a loop
2503+
// with foldBitcastOfShuffle. Reject in favor of foldBitcastOfShuffle.
2504+
if (!IsBinaryShuffle && Opcode == Instruction::BitCast) {
2505+
return false;
2506+
}
2507+
25022508
if (IsBinaryShuffle) {
25032509
if (C0->getSrcTy() != C1->getSrcTy())
25042510
return false;

0 commit comments

Comments
 (0)