Skip to content

Commit da4abe2

Browse files
committed
Add assertion for scalarizeInstruction
1 parent 912cccf commit da4abe2

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
@@ -2390,6 +2390,14 @@ void InnerLoopVectorizer::scalarizeInstruction(const Instruction *Instr,
23902390

23912391
// End if-block.
23922392
const VPRegionBlock *Region = RepRecipe->getParent()->getParent();
2393+
assert((Region ||
2394+
(RepRecipe->getOpcode() == Instruction::Store &&
2395+
isa<VPInstruction>(RepRecipe->getOperand(0)) &&
2396+
cast<VPInstruction>(RepRecipe->getOperand(0))->isVectorToScalar() &&
2397+
RepRecipe->getOperand(1)->isDefinedOutsideVectorRegions())) &&
2398+
"Expected a recipe either in a region, or a uniform store with a "
2399+
"vector-to-scalar stored value and an address defined outside "
2400+
"vectorized region.");
23932401
if (Region && Region->isReplicator())
23942402
PredicatedInstructions.push_back(Cloned);
23952403
}

0 commit comments

Comments
 (0)