[llvm] Perform bitreverse using AVX512 GFNI for i32 and i64. (PR #81764)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 02:32:34 PST 2024


================
@@ -1845,6 +1845,10 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
     setOperationAction(ISD::UMULO, MVT::v64i8, Custom);
 
     setOperationAction(ISD::BITREVERSE, MVT::v64i8,  Custom);
+    if (Subtarget.hasGFNI())
+      for (auto VT : {MVT::i32, MVT::v4i32, MVT::v8i32, MVT::v16i32, MVT::i64,
+                      MVT::v2i64, MVT::v4i64, MVT::v8i64})
+        setOperationAction(ISD::BITREVERSE, VT, Custom);
----------------
RKSimon wrote:

I have the feeling we'd be better off improving SSSE3/AVX/AVX512 coverage to always handle all vector types (not just vXi8) - and that would mean we could drop all the GFNI setOperationAction cases apart from the scalar types (which should be pulled out of the AVX512 case so Tremont can use them properly).

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


More information about the llvm-commits mailing list