Skip to content

Commit 65ff476

Browse files
committed
fixup! Remove unneed pattern now that tblgen can import sext_inreg
1 parent 7bdc9d8 commit 65ff476

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

llvm/lib/Target/RISCV/RISCVGISel.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ def : StPat<store, SD, GPR, PtrVT>;
170170
}
171171

172172
let Predicates = [IsRV64] in {
173-
// FIXME: tblgen can't import sext_inreg patterns.
174-
def : Pat<(sra (sexti32 (i64 GPR:$rs1)), uimm5:$shamt),
175-
(SRAIW GPR:$rs1, uimm5:$shamt)>;
176173
// FIXME: Temporary until i32->i64 zext is no longer legal.
177174
def : Pat <(srl (zext GPR:$rs1), uimm5:$shamt),
178175
(SRLIW GPR:$rs1, uimm5:$shamt)>;

llvm/test/CodeGen/RISCV/GlobalISel/rv64zbb-zbkb.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ define i8 @srai_i8(i8 %a) nounwind {
454454
; RV64ZBB-LABEL: srai_i8:
455455
; RV64ZBB: # %bb.0:
456456
; RV64ZBB-NEXT: sext.b a0, a0
457-
; RV64ZBB-NEXT: sraiw a0, a0, 5
457+
; RV64ZBB-NEXT: srai a0, a0, 5
458458
; RV64ZBB-NEXT: ret
459459
;
460460
; RV64ZBKB-LABEL: srai_i8:
@@ -496,7 +496,7 @@ define i16 @srai_i16(i16 %a) nounwind {
496496
; RV64ZBB-LABEL: srai_i16:
497497
; RV64ZBB: # %bb.0:
498498
; RV64ZBB-NEXT: sext.h a0, a0
499-
; RV64ZBB-NEXT: sraiw a0, a0, 9
499+
; RV64ZBB-NEXT: srai a0, a0, 9
500500
; RV64ZBB-NEXT: ret
501501
;
502502
; RV64ZBKB-LABEL: srai_i16:

llvm/test/CodeGen/RISCV/GlobalISel/rv64zbb.ll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,12 +1113,14 @@ define i32 @abs_i32(i32 %x) {
11131113
ret i32 %abs
11141114
}
11151115

1116+
; FIXME: sext.w is not needed
11161117
define signext i32 @abs_i32_sext(i32 signext %x) {
11171118
; RV64I-LABEL: abs_i32_sext:
11181119
; RV64I: # %bb.0:
1119-
; RV64I-NEXT: sraiw a1, a0, 31
1120-
; RV64I-NEXT: addw a0, a0, a1
1120+
; RV64I-NEXT: srai a1, a0, 31
1121+
; RV64I-NEXT: add a0, a0, a1
11211122
; RV64I-NEXT: xor a0, a0, a1
1123+
; RV64I-NEXT: sext.w a0, a0
11221124
; RV64I-NEXT: ret
11231125
;
11241126
; RV64ZBB-LABEL: abs_i32_sext:

0 commit comments

Comments
 (0)