Skip to content

Commit b97c447

Browse files
authored
[SLP] NFC. Add assert for shouldBroadcast and canBeVectorized. (#119327)
1 parent edc50f3 commit b97c447

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2460,6 +2460,8 @@ class BoUpSLP {
24602460
/// the whole vector (it is mixed with constants or loop invariant values).
24612461
/// Note: This modifies the 'IsUsed' flag, so a cleanUsed() must follow.
24622462
bool shouldBroadcast(Value *Op, unsigned OpIdx, unsigned Lane) {
2463+
assert(Op == getValue(OpIdx, Lane) &&
2464+
"Op is expected to be getValue(OpIdx, Lane).");
24632465
// Small number of loads - try load matching.
24642466
if (isa<LoadInst>(Op) && getNumLanes() == 2 && getNumOperands() == 2)
24652467
return false;
@@ -2517,6 +2519,8 @@ class BoUpSLP {
25172519
/// Checks if there is at least single compatible operand in lanes other
25182520
/// than \p Lane, compatible with the operand \p Op.
25192521
bool canBeVectorized(Instruction *Op, unsigned OpIdx, unsigned Lane) const {
2522+
assert(Op == getValue(OpIdx, Lane) &&
2523+
"Op is expected to be getValue(OpIdx, Lane).");
25202524
bool OpAPO = getData(OpIdx, Lane).APO;
25212525
for (unsigned Ln = 0, Lns = getNumLanes(); Ln != Lns; ++Ln) {
25222526
if (Ln == Lane)

0 commit comments

Comments
 (0)