[llvm] [VPlan] Use VPWidenIntrinsicRecipe to vp.select. (PR #110489)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 09:03:23 PDT 2024


================
@@ -1042,6 +1041,14 @@ StringRef VPWidenIntrinsicRecipe::getIntrinsicName() const {
   return Intrinsic::getBaseName(VectorIntrinsicID);
 }
 
+bool VPWidenIntrinsicRecipe::onlyFirstLaneUsed(const VPValue *Op) const {
+  assert(is_contained(operands(), Op) && "Op must be an operand of the recipe");
+  // Vector predication intrinsics only demand the the first lane the last
+  // operand (the EVL operand).
+  return VPIntrinsic::isVPIntrinsic(VectorIntrinsicID) &&
+         Op == getOperand(getNumOperands() - 1);
----------------
Mel-Chen wrote:

Dropped the related changes while resolving conflicts, as the patch can still function even without considering `isVectorIntrinsicWithScalarOpAtArg`. So far, I haven't encountered any related cases.

https://github.com/llvm/llvm-project/pull/110489


More information about the llvm-commits mailing list