Skip to content

Commit 200afcf

Browse files
committed
[RISCV] Add combines_for_extload to RISCVPostLegalizerCombiner.
1 parent b7a8f5f commit 200afcf

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
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/rv64zbb.ll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -791,9 +791,7 @@ define signext i32 @ctpop_i32_load(ptr %p) nounwind {
791791
;
792792
; RV64ZBB-LABEL: ctpop_i32_load:
793793
; RV64ZBB: # %bb.0:
794-
; RV64ZBB-NEXT: lw a0, 0(a0)
795-
; RV64ZBB-NEXT: slli a0, a0, 32
796-
; RV64ZBB-NEXT: srli a0, a0, 32
794+
; RV64ZBB-NEXT: lwu a0, 0(a0)
797795
; RV64ZBB-NEXT: cpopw a0, a0
798796
; RV64ZBB-NEXT: ret
799797
%a = load i32, ptr %p

0 commit comments

Comments
 (0)