[llvm] [VPlan] Expand simple SCEVs directly to VPInstructions. (PR #189455)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 05:04:00 PDT 2026


================
@@ -856,3 +857,35 @@ bool vputils::isUsedByLoadStoreAddress(const VPValue *V) {
   }
   return false;
 }
+
+VPValue *VPBuilder::VPSCEVExpander::expand(const SCEV *S) {
+  switch (S->getSCEVType()) {
+  case scConstant:
+    return Plan.getOrAddLiveIn(cast<SCEVConstant>(S)->getValue());
+  case scUnknown:
+    return Plan.getOrAddLiveIn(cast<SCEVUnknown>(S)->getValue());
+  case scVScale:
+    return Builder.createNaryOp(VPInstruction::VScale, {}, S->getType());
----------------
ayalz wrote:

Might have been worth committing separately, as most test changes involve vscale.

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


More information about the llvm-commits mailing list