[llvm] 9e45e7f - [RISCV][GISel] Remove unused isel patterns for s32 shifts with s64 shift amount.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 23:19:15 PDT 2024


Author: Craig Topper
Date: 2024-09-30T23:18:06-07:00
New Revision: 9e45e7facbdec209a06ee20fcfbb7d0622835e21

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

LOG: [RISCV][GISel] Remove unused isel patterns for s32 shifts with s64 shift amount.

The legalizer doesn't appear to create these.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVGISel.td b/llvm/lib/Target/RISCV/RISCVGISel.td
index 84c00d31800cee..e14de46673aba8 100644
--- a/llvm/lib/Target/RISCV/RISCVGISel.td
+++ b/llvm/lib/Target/RISCV/RISCVGISel.td
@@ -95,10 +95,6 @@ def : Pat<(XLenVT (sub GPR:$rs1, simm12Plus1:$imm)),
 let Predicates = [IsRV64] in {
 def : Pat<(i32 (sub GPR:$rs1, simm12Plus1i32:$imm)),
           (ADDIW GPR:$rs1, (i64 (NegImm $imm)))>;
-
-def : Pat<(i32 (shl GPR:$rs1, (i32 GPR:$rs2))), (SLLW GPR:$rs1, GPR:$rs2)>;
-def : Pat<(i32 (sra GPR:$rs1, (i32 GPR:$rs2))), (SRAW GPR:$rs1, GPR:$rs2)>;
-def : Pat<(i32 (srl GPR:$rs1, (i32 GPR:$rs2))), (SRLW GPR:$rs1, GPR:$rs2)>;
 }
 
 // Ptr type used in patterns with GlobalISelEmitter
@@ -195,9 +191,9 @@ def : PatGprGpr<sub, SUBW, i32, i32>;
 def : PatGprGpr<and, AND, i32, i32>;
 def : PatGprGpr<or, OR, i32, i32>;
 def : PatGprGpr<xor, XOR, i32, i32>;
-def : PatGprGpr<shiftopw<shl>, SLLW, i32, i64>;
-def : PatGprGpr<shiftopw<srl>, SRLW, i32, i64>;
-def : PatGprGpr<shiftopw<sra>, SRAW, i32, i64>;
+def : PatGprGpr<shl, SLLW, i32, i32>;
+def : PatGprGpr<srl, SRLW, i32, i32>;
+def : PatGprGpr<sra, SRAW, i32, i32>;
 
 def : Pat<(i32 (add GPR:$rs1, simm12i32:$imm)),
           (ADDIW GPR:$rs1, (i64 (as_i64imm $imm)))>;


        


More information about the llvm-commits mailing list