[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.
This commit is contained in:
Craig Topper 2021-01-31 19:54:48 -08:00
parent 94206f1f90
commit ce27b32715
1 changed files with 13 additions and 21 deletions

View File

@ -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.