[llvm] [IA][RISCV] Add support for vp.load/vp.store with shufflevector (PR #135445)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 30 15:06:55 PDT 2025


================
@@ -644,13 +740,25 @@ static Value *getMask(Value *WideMask, unsigned Factor) {
     }
   }
 
-  if (match(WideMask, m_AllOnes())) {
-    // Scale the vector length of all-ones mask.
-    ElementCount OrigEC =
-        cast<VectorType>(WideMask->getType())->getElementCount();
-    assert(OrigEC.getKnownMinValue() % Factor == 0);
-    return ConstantVector::getSplat(OrigEC.divideCoefficientBy(Factor),
-                                    cast<Constant>(WideMask)->getSplatValue());
+  if (auto *ConstMask = dyn_cast<Constant>(WideMask)) {
+    if (auto *Splat = ConstMask->getSplatValue()) {
+      // All-ones or all-zeros mask.
+      return ConstantVector::getSplat(LeafValueEC, Splat);
+    } else if (LeafValueEC.isFixed()) {
----------------
topperc wrote:

No `else` after `return`

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


More information about the llvm-commits mailing list