[llvm] [LV] Don't consider VPValues without underlying value as generating vectors (PR #150992)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 29 00:27:38 PDT 2025


================
@@ -4247,6 +4248,9 @@ static bool willGenerateVectors(VPlan &Plan, ElementCount VF,
       // operand.
       VPValue *ToCheck =
           R.getNumDefinedValues() >= 1 ? R.getVPValue(0) : R.getOperand(1);
+      // Don't consider values that didn't come from the original scalar IR.
+      if (!ToCheck->getUnderlyingValue())
----------------
lukel97 wrote:

I think live ins are different, they're just LLVM IR values plumbed directly into VPlan like constants/loop invariant stuff etc.

IIUC getUnderlyingValue should return the original scalar IR value for a widened recipe, which might be loop variant. 

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


More information about the llvm-commits mailing list