[llvm] [RISCV] Sink vp.splat operands of VP intrinsic. (PR #133245)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 11 18:32:53 PDT 2025


================
@@ -2823,41 +2823,55 @@ bool RISCVTTIImpl::isProfitableToSinkOperands(
   if (!ST->sinkSplatOperands())
     return false;
 
-  for (auto OpIdx : enumerate(I->operands())) {
-    if (!canSplatOperand(I, OpIdx.index()))
-      continue;
+  // Capture EVL value.
+  Value *EVL = nullptr;
+  if (auto *VPI = dyn_cast<VPIntrinsic>(I))
+    EVL = VPI->getVectorLengthParam();
----------------
lukel97 wrote:

The lanes past EVL will be poison, and it's safe to replace poison with anything. So I think we might not actually need to check EVL. 

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


More information about the llvm-commits mailing list