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

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 3 07:15:03 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();
----------------
RKSimon wrote:

I'm not certain we need the getScalarSizeInBits/isTypeLegal tests anymore as the GF2P8AFFINEQB should confirm it - maybe just:
```
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