[llvm-branch-commits] [llvm] c7d5d8f - [RISCV] Group some Zbs isel patterns together and remove a stale comment. NFC

Craig Topper via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Jan 23 16:59:05 PST 2021


Author: Craig Topper
Date: 2021-01-23T16:45:05-08:00
New Revision: c7d5d8fa33a0f23b262b695d17fdffdefa8dc940

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

LOG: [RISCV] Group some Zbs isel patterns together and remove a stale comment. NFC

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVInstrInfoB.td

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVInstrInfoB.td b/llvm/lib/Target/RISCV/RISCVInstrInfoB.td
index 8740e61b1ee1..9940063d5f9a 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoB.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoB.td
@@ -725,6 +725,9 @@ def : Pat<(or GPR:$rs1, BSETINVMask:$mask),
           (BSETI GPR:$rs1, (BSETINVXForm imm:$mask))>;
 def : Pat<(xor GPR:$rs1, BSETINVMask:$mask),
           (BINVI GPR:$rs1, (BSETINVXForm imm:$mask))>;
+
+def : Pat<(and (srl GPR:$rs1, uimmlog2xlen:$shamt), (XLenVT 1)),
+          (BEXTI GPR:$rs1, uimmlog2xlen:$shamt)>;
 }
 
 let Predicates = [HasStdExtZbp] in {
@@ -743,12 +746,6 @@ def : Pat<(rotl GPR:$rs1, uimmlog2xlen:$shamt),
           (RORI GPR:$rs1, (ImmROTL2R uimmlog2xlen:$shamt))>;
 }
 
-// We don't pattern-match sbclri[w], sbseti[w], sbinvi[w] because they are
-// pattern-matched by simple andi, ori, and xori.
-let Predicates = [HasStdExtZbs] in
-def : Pat<(and (srl GPR:$rs1, uimmlog2xlen:$shamt), (XLenVT 1)),
-          (BEXTI GPR:$rs1, uimmlog2xlen:$shamt)>;
-
 def riscv_grevi    : SDNode<"RISCVISD::GREVI", SDTIntBinOp, []>;
 def riscv_greviw   : SDNode<"RISCVISD::GREVIW", SDTIntBinOp, []>;
 def riscv_gorci    : SDNode<"RISCVISD::GORCI", SDTIntBinOp, []>;


        


More information about the llvm-branch-commits mailing list