Skip to content

Commit 3ecb19a

Browse files
committed
Add assertion for scalarizeInstruction
1 parent 807579f commit 3ecb19a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,6 +2380,14 @@ void InnerLoopVectorizer::scalarizeInstruction(const Instruction *Instr,
23802380
// End if-block.
23812381
VPRegionBlock *Parent = RepRecipe->getParent()->getParent();
23822382
bool IfPredicateInstr = Parent ? Parent->isReplicator() : false;
2383+
assert((Parent ||
2384+
(RepRecipe->getOpcode() == Instruction::Store &&
2385+
isa<VPInstruction>(RepRecipe->getOperand(0)) &&
2386+
cast<VPInstruction>(RepRecipe->getOperand(0))->isVectorToScalar() &&
2387+
RepRecipe->getOperand(1)->isDefinedOutsideLoopRegions())) &&
2388+
"Expected a recipe either in a region, or a uniform store with a "
2389+
"vector-to-scalar stored value and an address defined outside "
2390+
"vectorized region.");
23832391
if (IfPredicateInstr)
23842392
PredicatedInstructions.push_back(Cloned);
23852393
}

0 commit comments

Comments
 (0)