Skip to content

Commit 9a490a3

Browse files
committed
Fix the ICE
VPlanRecipes.cpp:735: virtual void llvm::VPInstruction::execute(llvm::VPTransformState&): Assertion `(GeneratedValue->getType()->isVectorTy() == !GeneratesPerFirstLaneOnly || State.VF.isScalar()) && "scalar value but not only first lane defined"' failed.
1 parent 23f9e8a commit 9a490a3

File tree

1 file changed

+15
-0
lines changed
  • llvm/lib/Transforms/Vectorize

1 file changed

+15
-0
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,6 +1706,21 @@ class VPWidenIntrinsicRecipe : public VPRecipeWithIRFlags {
17061706
void print(raw_ostream &O, const Twine &Indent,
17071707
VPSlotTracker &SlotTracker) const override;
17081708
#endif
1709+
1710+
bool onlyFirstLaneUsed(const VPValue *Op) const override {
1711+
assert(is_contained(operands(), Op) &&
1712+
"Op must be an operand of the recipe");
1713+
SmallVector<unsigned, 4> Idx;
1714+
for (const auto &I : enumerate(operands()))
1715+
if (Op == I.value())
1716+
Idx.push_back(I.index());
1717+
1718+
return all_of(Idx, [this](unsigned I) {
1719+
return isVectorIntrinsicWithScalarOpAtArg(VectorIntrinsicID, I) ||
1720+
(VPIntrinsic::isVPIntrinsic(VectorIntrinsicID) &&
1721+
I == getNumOperands() - 1);
1722+
});
1723+
}
17091724
};
17101725

17111726
/// A recipe for widening Call instructions using library calls.

0 commit comments

Comments
 (0)