[llvm] [SVE] Wide active lane mask (PR #76514)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 01:26:43 PST 2024


================
@@ -19791,15 +19792,63 @@ static SDValue performIntrinsicCombine(SDNode *N,
           EVT::getVectorVT(*DAG.getContext(), PromVT.getVectorElementType(),
                            VT.getVectorElementCount());
 
-      Res = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, WhileVT, ID,
-                        N->getOperand(1), N->getOperand(2));
+      SDValue Res = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, WhileVT, ID,
+                                N->getOperand(1), N->getOperand(2));
       Res = DAG.getNode(ISD::SIGN_EXTEND, DL, PromVT, Res);
       Res = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, ExtVT, Res,
                         DAG.getConstant(0, DL, MVT::i64));
       Res = DAG.getNode(ISD::TRUNCATE, DL, VT, Res);
+
+      return Res;
     }
-    return Res;
+
+    if (!Subtarget->hasSVE2p1() && !Subtarget->hasSME2())
+      return SDValue();
+
+    if (!N->hasNUsesOfValue(2, 0))
----------------
david-arm wrote:

Ah ok, in that case I think it's just the commit structure isn't right then because this code was added in the first commit, but there are no tests for it. It looks like we're adding code that in one commit that is only being tested in another. For example, in the first commit there is the test get-active-lane-mask-32x1.ll, which looks like it cannot pass because there is only one use of the intrinsic result in IR. 

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


More information about the llvm-commits mailing list