Skip to content

Commit cbdf1a2

Browse files
committed
fixup! Add combines_for_extload to RISCVPostLegalizerCombiner.
1 parent 5899f5e commit cbdf1a2

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

llvm/lib/Target/RISCV/RISCVCombine.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ def RISCVO0PreLegalizerCombiner: GICombiner<
2323
// TODO: Add more combines.
2424
def RISCVPostLegalizerCombiner
2525
: GICombiner<"RISCVPostLegalizerCombinerImpl",
26-
[redundant_and, identity_combines, commute_constant_to_rhs,
27-
constant_fold_cast_op]> {
26+
[combines_for_extload, redundant_and, identity_combines,
27+
commute_constant_to_rhs, constant_fold_cast_op]> {
2828
}

llvm/test/CodeGen/RISCV/GlobalISel/double-convert.ll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ define double @fcvt_d_wu_load(ptr %p) nounwind {
106106
;
107107
; RV64IFD-LABEL: fcvt_d_wu_load:
108108
; RV64IFD: # %bb.0:
109-
; RV64IFD-NEXT: lw a0, 0(a0)
110-
; RV64IFD-NEXT: slli a0, a0, 32
111-
; RV64IFD-NEXT: srli a0, a0, 32
109+
; RV64IFD-NEXT: lwu a0, 0(a0)
112110
; RV64IFD-NEXT: fcvt.d.wu fa0, a0
113111
; RV64IFD-NEXT: ret
114112
%a = load i32, ptr %p

llvm/test/CodeGen/RISCV/GlobalISel/float-convert.ll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ define float @fcvt_s_wu_load(ptr %p) nounwind {
109109
;
110110
; RV64IF-LABEL: fcvt_s_wu_load:
111111
; RV64IF: # %bb.0:
112-
; RV64IF-NEXT: lw a0, 0(a0)
113-
; RV64IF-NEXT: slli a0, a0, 32
114-
; RV64IF-NEXT: srli a0, a0, 32
112+
; RV64IF-NEXT: lwu a0, 0(a0)
115113
; RV64IF-NEXT: fcvt.s.wu fa0, a0
116114
; RV64IF-NEXT: ret
117115
%a = load i32, ptr %p

0 commit comments

Comments
 (0)