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

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 00:28:41 PDT 2024


================
@@ -31345,7 +31392,8 @@ static SDValue LowerBITREVERSE(SDValue Op, const X86Subtarget &Subtarget,
   // If we have GFNI, we can use GF2P8AFFINEQB to reverse the bits.
   if (Subtarget.hasGFNI()) {
     MVT MatrixVT = MVT::getVectorVT(MVT::i64, NumElts / 8);
-    SDValue Matrix = DAG.getConstant(0x8040201008040201ULL, DL, MatrixVT);
+    SDValue Matrix =
+        DAG.getConstant(getGFNICtrlImm(ISD::BITREVERSE), DL, MatrixVT);
----------------
shamithoke wrote:

Perhaps 
assert (Op.getOpcode() == ISD::BITREVERSE)?

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


More information about the llvm-commits mailing list