[llvm] [X86] Use GFNI for vXi8 shifts/rotates (PR #89115)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 17 20:12:08 PDT 2024


================
@@ -30022,6 +30057,18 @@ static SDValue LowerRotate(SDValue Op, const X86Subtarget &Subtarget,
                          DAG.getNode(ISD::SUB, DL, VT, Z, Amt));
   }
 
+  // Attempt to use GFNI gf2p8affine to rotate vXi8 by an uniform constant.
+  if (IsCstSplat && Subtarget.hasGFNI() &&
+      (VT == MVT::v16i8 || (VT == MVT::v32i8 && Subtarget.hasAVX()) ||
+       (VT == MVT::v64i8 && Subtarget.useBWIRegs()))) {
----------------
phoebewang wrote:

The 512-bit GFNI requires AVX512F instead of AVX512BW. How about check element type is `i8` and VT is legal?

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


More information about the llvm-commits mailing list