[llvm] [X86] Fold vgf2p8affineqb XOR with splat constant into immediate (PR #179103)

via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 3 08:53:26 PST 2026


================
@@ -55858,6 +55821,34 @@ static SDValue foldXor1SetCC(SDNode *N, const SDLoc &DL, SelectionDAG &DAG) {
   return getSETCC(NewCC, LHS->getOperand(1), DL, DAG);
 }
 
+static SDValue combineXorWithGF2P8AFFINEQB(SDNode *N, const SDLoc &DL,
+                                           SelectionDAG &DAG, EVT VT) {
+  using namespace SDPatternMatch;
+
+  if (VT.getScalarSizeInBits() != 8)
+    return SDValue();
+
+  if (!DAG.getTargetLoweringInfo().isTypeLegal(VT.getSimpleVT()))
+    return SDValue();
----------------
bala-bhargav wrote:

Done! Replaced the type checks with an assert after the pattern match:
`assert((VT == MVT::v16i8 || VT == MVT::v32i8 || VT == MVT::v64i8) && "Unsupported GFNI type");`

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


More information about the llvm-commits mailing list