[llvm] [x86] Add lowering for `@llvm.experimental.vector.compress` (PR #104904)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 01:36:52 PDT 2024


================
@@ -2321,6 +2321,18 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
     }
   }
 
+  if (Subtarget.hasAVX512()) {
+    for (MVT VT : {MVT::v4i32, MVT::v4f32, MVT::v2i64, MVT::v2f64, MVT::v8i32,
+                   MVT::v8f32, MVT::v4i64, MVT::v4f64, MVT::v16i32, MVT::v16f32,
+                   MVT::v8i64, MVT::v8f64})
+      setOperationAction(ISD::VECTOR_COMPRESS, VT, Legal);
+
+    if (Subtarget.hasVBMI2())
+      for (MVT VT : {MVT::v16i8, MVT::v8i16, MVT::v32i8, MVT::v16i16,
+                     MVT::v64i8, MVT::v32i16})
+        setOperationAction(ISD::VECTOR_COMPRESS, VT, Legal);
+  }
----------------
RKSimon wrote:

These need to account for VLX support

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


More information about the llvm-commits mailing list