[llvm] [VPlan] Generalize usesScalars using WideInfo (NFCI) (PR #208910)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 03:35:02 PDT 2026


================
@@ -56,6 +56,12 @@ static cl::opt<bool> VPlanPrintMetadata(
     cl::desc("Controls the printing of recipe metadata when debugging."));
 #endif
 
+bool VPUser::usesScalars(const VPValue *Op) const {
+  assert(is_contained(operands(), Op) && "Op must be an operand of the recipe");
+  VPWideningInfo WideInfo = vputils::getWideningInfo(*cast<VPRecipeBase>(this));
+  return WideInfo.hasSingleScalarOperands() || usesFirstLaneOnly(Op);
----------------
artagnon wrote:

Replicates are covered by this, yes: maybe hasSingleScalarOperands isn't the best name; would be open to other suggestions. It seems to be NFC due to the limited use of usesScalars: will check on test-suite.

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


More information about the llvm-commits mailing list