[llvm] [x86] Add lowering for `@llvm.experimental.vector.compress` (PR #104904)
Lawrence Benson via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 31 05:09:57 PDT 2024
================
@@ -2125,6 +2125,35 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
for (auto VT : { MVT::v4i32, MVT::v8i32, MVT::v2i64, MVT::v4i64 })
setOperationAction(ISD::CTPOP, VT, Legal);
}
+
+ // We can try to convert vectors to different sizes to leverage legal
+ // `vpcompress` cases. So we mark these supported vector sizes as Custom and
+ // then specialize to Legal below.
+ for (MVT VT : {MVT::v8i32, MVT::v8f32, MVT::v4i32, MVT::v4f32, MVT::v4i64,
+ MVT::v4f64, MVT::v2i64, MVT::v2f64, MVT::v16i8, MVT::v8i16,
+ MVT::v16i16, MVT::v8i8})
----------------
lawben wrote:
I just thought that if we can trivially handle this, why not add it. I can also remove it if we only want legal types here.
https://github.com/llvm/llvm-project/pull/104904
More information about the llvm-commits
mailing list