[llvm] [LLVM] Add `llvm.masked.compress` intrinsic (PR #92289)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri May 17 09:08:01 PDT 2024


================
@@ -11226,6 +11226,53 @@ SDValue TargetLowering::expandVectorSplice(SDNode *Node,
                      MachinePointerInfo::getUnknownStack(MF));
 }
 
+SDValue TargetLowering::expandMCOMPRESS(SDNode *Node, SelectionDAG &DAG) const {
+  SDLoc DL(Node);
+  SDValue Vec = Node->getOperand(0);
+  SDValue Mask = Node->getOperand(1);
+
+  EVT VecVT = Vec.getValueType();
+  EVT ScalarVT = VecVT.getScalarType();
+  EVT MaskScalarVT = Mask.getValueType().getScalarType();
+
+  if (VecVT.isScalableVector())
+    report_fatal_error(
+        "Expanding masked_compress for scalable vectors is undefined.");
----------------
arsenm wrote:

Verifier needs to enforce this 

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


More information about the llvm-commits mailing list