[llvm] [PowerPC] Exploit xxeval instruction for ternary patterns - part 1 (PR #141733)

Lei Huang via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 22 10:58:05 PDT 2025


================
@@ -2192,83 +2302,87 @@ let Predicates = [PrefixInstrs, HasP10Vector] in {
     // Anonymous patterns for XXEVAL
     // AND
     // and(A, B, C)
-    def : XXEvalPattern<(and v4i32:$vA, (and v4i32:$vB, v4i32:$vC)), 1>;
-    // and(A, xor(B, C))
-    def : XXEvalPattern<(and v4i32:$vA, (xor v4i32:$vB, v4i32:$vC)), 6>;
-    // and(A, or(B, C))
-    def : XXEvalPattern<(and v4i32:$vA, (or v4i32:$vB, v4i32:$vC)), 7>;
-    // and(A, nor(B, C))
-    def : XXEvalPattern<(and v4i32:$vA, (vnot (or v4i32:$vB, v4i32:$vC))), 8>;
-    // and(A, eqv(B, C))
-    def : XXEvalPattern<(and v4i32:$vA, (vnot (xor v4i32:$vB, v4i32:$vC))), 9>;
-    // and(A, nand(B, C))
-    def : XXEvalPattern<(and v4i32:$vA, (vnot (and v4i32:$vB, v4i32:$vC))), 14>;
+    def : Pat<(v4i32 (and v4i32:$vA, (and v4i32:$vB, v4i32:$vC))), 
----------------
lei137 wrote:

These look like unrelated changes other then you are reusing the class name `XXEvalPattern`.  Can you pick a new name for your multi-class since these are simple patterns before and it's less readable when redefined via the more complicated multi-class definition.  

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


More information about the llvm-commits mailing list