[llvm] ce27b32 - [Mips] Cleanup isel patterns to use 'vnot' instead of (xor X, immAllOnesV). NFCI

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 31 20:04:14 PST 2021


Author: Craig Topper
Date: 2021-01-31T20:01:05-08:00
New Revision: ce27b327158e6ae7b726b6d867b7db5117a90b73

URL: https://github.com/llvm/llvm-project/commit/ce27b327158e6ae7b726b6d867b7db5117a90b73
DIFF: https://github.com/llvm/llvm-project/commit/ce27b327158e6ae7b726b6d867b7db5117a90b73.diff

LOG: [Mips] Cleanup isel patterns to use 'vnot' instead of (xor X, immAllOnesV). NFCI

A couple patterns used bitconvert on the immAllOnesV, but
the isel matching uses ISD::isBuildVectorAllOnes which
is able to look through bitcasts. So isel patterns don't need
to do it explicitly.

Added: 
    

Modified: 
    llvm/lib/Target/Mips/MipsMSAInstrInfo.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Mips/MipsMSAInstrInfo.td b/llvm/lib/Target/Mips/MipsMSAInstrInfo.td
index 3e32574596ca..301f1c158010 100644
--- a/llvm/lib/Target/Mips/MipsMSAInstrInfo.td
+++ b/llvm/lib/Target/Mips/MipsMSAInstrInfo.td
@@ -365,18 +365,14 @@ def vsplat_imm_eq_1 : PatLeaf<(build_vector), [{
 }]>;
 
 def vbclr_b : PatFrag<(ops node:$ws, node:$wt),
-                      (and node:$ws, (xor (shl vsplat_imm_eq_1, node:$wt),
-                                          immAllOnesV))>;
+                      (and node:$ws, (vnot (shl vsplat_imm_eq_1, node:$wt)))>;
 def vbclr_h : PatFrag<(ops node:$ws, node:$wt),
-                      (and node:$ws, (xor (shl vsplat_imm_eq_1, node:$wt),
-                                          immAllOnesV))>;
+                      (and node:$ws, (vnot (shl vsplat_imm_eq_1, node:$wt)))>;
 def vbclr_w : PatFrag<(ops node:$ws, node:$wt),
-                      (and node:$ws, (xor (shl vsplat_imm_eq_1, node:$wt),
-                                          immAllOnesV))>;
+                      (and node:$ws, (vnot (shl vsplat_imm_eq_1, node:$wt)))>;
 def vbclr_d : PatFrag<(ops node:$ws, node:$wt),
-                      (and node:$ws, (xor (shl (v2i64 vsplati64_imm_eq_1),
-                                               node:$wt),
-                                          (bitconvert (v4i32 immAllOnesV))))>;
+                      (and node:$ws, (vnot (shl (v2i64 vsplati64_imm_eq_1),
+                                               node:$wt)))>;
 
 def vbneg_b : PatFrag<(ops node:$ws, node:$wt),
                       (xor node:$ws, (shl vsplat_imm_eq_1, node:$wt))>;
@@ -3884,21 +3880,17 @@ defm : MSAShiftPats<sra, "SRA">;
 defm : MSABitPats<xor, "BNEG">;
 defm : MSABitPats<or, "BSET">;
 
-def : MSAPat<(and v16i8:$ws, (xor (shl vsplat_imm_eq_1,
-                                       (vsplati8imm7 v16i8:$wt)),
-                                  immAllOnesV)),
+def : MSAPat<(and v16i8:$ws, (vnot (shl vsplat_imm_eq_1,
+                                        (vsplati8imm7 v16i8:$wt)))),
              (v16i8 (BCLR_B v16i8:$ws, v16i8:$wt))>;
-def : MSAPat<(and v8i16:$ws, (xor (shl vsplat_imm_eq_1,
-                                       (vsplati16imm15 v8i16:$wt)),
-                             immAllOnesV)),
+def : MSAPat<(and v8i16:$ws, (vnot (shl vsplat_imm_eq_1,
+                                        (vsplati16imm15 v8i16:$wt)))),
              (v8i16 (BCLR_H v8i16:$ws, v8i16:$wt))>;
-def : MSAPat<(and v4i32:$ws, (xor (shl vsplat_imm_eq_1,
-                                       (vsplati32imm31 v4i32:$wt)),
-                             immAllOnesV)),
+def : MSAPat<(and v4i32:$ws, (vnot (shl vsplat_imm_eq_1,
+                                        (vsplati32imm31 v4i32:$wt)))),
              (v4i32 (BCLR_W v4i32:$ws, v4i32:$wt))>;
-def : MSAPat<(and v2i64:$ws, (xor (shl (v2i64 vsplati64_imm_eq_1),
-                                       (vsplati64imm63 v2i64:$wt)),
-                                  (bitconvert (v4i32 immAllOnesV)))),
+def : MSAPat<(and v2i64:$ws, (vnot (shl (v2i64 vsplati64_imm_eq_1),
+                                        (vsplati64imm63 v2i64:$wt)))),
              (v2i64 (BCLR_D v2i64:$ws, v2i64:$wt))>;
 
 // Vector extraction with fixed index.


        


More information about the llvm-commits mailing list