[llvm] [IA][RISCV] Detecting gap mask from a mask assembled by interleaveN intrinsics (PR #153510)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 13 22:29:44 PDT 2025


================
@@ -596,7 +596,26 @@ static std::pair<Value *, APInt> getMask(Value *WideMask, unsigned Factor,
 
   if (auto *IMI = dyn_cast<IntrinsicInst>(WideMask)) {
     if (unsigned F = getInterleaveIntrinsicFactor(IMI->getIntrinsicID());
-        F && F == Factor && llvm::all_equal(IMI->args())) {
+        F && F == Factor) {
+      Value *RefArg = nullptr;
+      // Check if all the intrinsic arguments are the same, except those that
+      // are zeros, which we mark them as gaps in the gap mask.
----------------
topperc wrote:

```suggestion
      // are zeros, which we mark as gaps in the gap mask.
```

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


More information about the llvm-commits mailing list