Skip to content

Commit 353adf0

Browse files
committed
Check all operands
1 parent 2cfab8b commit 353adf0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,8 +1364,13 @@ StringRef VPWidenIntrinsicRecipe::getIntrinsicName() const {
13641364

13651365
bool VPWidenIntrinsicRecipe::onlyFirstLaneUsed(const VPValue *Op) const {
13661366
assert(is_contained(operands(), Op) && "Op must be an operand of the recipe");
1367-
unsigned Idx = std::distance(op_begin(), find(operands(), Op));
1368-
return isVectorIntrinsicWithScalarOpAtArg(VectorIntrinsicID, Idx, nullptr);
1367+
for (auto [Idx, V] : enumerate(operands())) {
1368+
if (V != Op)
1369+
continue;
1370+
if (!isVectorIntrinsicWithScalarOpAtArg(VectorIntrinsicID, Idx, nullptr))
1371+
return false;
1372+
}
1373+
return true;
13691374
}
13701375

13711376
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)

0 commit comments

Comments
 (0)