Skip to content

Commit 5b53fa0

Browse files
authored
[RISCV] Enable -riscv-enable-sink-fold by default. (#82026)
AArch64 has had it enabled since late November, so hopefully the main issues have been resolved. I see a small reduction in dynamic instruction count on every benchmark in specint2017. The best improvement was 0.3% so nothing amazing.
1 parent c1716e3 commit 5b53fa0

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

llvm/lib/Target/RISCV/RISCVTargetMachine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static cl::opt<bool> EnableRISCVDeadRegisterElimination(
8484
static cl::opt<bool>
8585
EnableSinkFold("riscv-enable-sink-fold",
8686
cl::desc("Enable sinking and folding of instruction copies"),
87-
cl::init(false), cl::Hidden);
87+
cl::init(true), cl::Hidden);
8888

8989
static cl::opt<bool>
9090
EnableLoopDataPrefetch("riscv-enable-loop-data-prefetch", cl::Hidden,

llvm/test/CodeGen/RISCV/fold-addi-loadstore.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
22
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3-
; RUN: -riscv-enable-sink-fold | FileCheck -check-prefix=RV32I %s
3+
; RUN: | FileCheck -check-prefix=RV32I %s
44
; RUN: llc -mtriple=riscv32 -verify-machineinstrs -code-model=medium < %s \
5-
; RUN: -riscv-enable-sink-fold | FileCheck -check-prefix=RV32I-MEDIUM %s
5+
; RUN: | FileCheck -check-prefix=RV32I-MEDIUM %s
66
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
7-
; RUN: -riscv-enable-sink-fold | FileCheck -check-prefix=RV64I %s
7+
; RUN: | FileCheck -check-prefix=RV64I %s
88
; RUN: llc -mtriple=riscv64 -verify-machineinstrs -code-model=medium < %s \
9-
; RUN: -riscv-enable-sink-fold | FileCheck -check-prefix=RV64I-MEDIUM %s
9+
; RUN: | FileCheck -check-prefix=RV64I-MEDIUM %s
1010

1111
; We can often fold an ADDI into the offset of load/store instructions:
1212
; (load (addi base, off1), off2) -> (load base, off1+off2)

llvm/test/CodeGen/RISCV/rvv/fixed-vectors-masked-gather.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
22
; RUN: llc -mtriple=riscv32 -mattr=+m,+d,+zfh,+zvfh,+v -target-abi=ilp32d \
3-
; RUN: -riscv-enable-sink-fold -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32,RV32V
3+
; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32,RV32V
44
; RUN: llc -mtriple=riscv64 -mattr=+m,+d,+zfh,+zvfh,+v -target-abi=lp64d \
5-
; RUN: -riscv-enable-sink-fold -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64,RV64V
5+
; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64,RV64V
66
; RUN: llc -mtriple=riscv32 -mattr=+m,+d,+zfh,+zvfh,+zve32f,+zvl128b -target-abi=ilp32d \
7-
; RUN: -riscv-enable-sink-fold -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32,RV32ZVE32F
7+
; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32,RV32ZVE32F
88
; RUN: llc -mtriple=riscv64 -mattr=+m,+d,+zfh,+zvfh,+zve32f,+zvl128b -target-abi=lp64d \
9-
; RUN: -riscv-enable-sink-fold -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64,RV64ZVE32F
9+
; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64,RV64ZVE32F
1010

1111
declare <1 x i8> @llvm.masked.gather.v1i8.v1p0(<1 x ptr>, i32, <1 x i1>, <1 x i8>)
1212

llvm/test/CodeGen/RISCV/split-offsets.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -mtriple=riscv32 -verify-machineinstrs -riscv-enable-sink-fold < %s \
2+
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
33
; RUN: | FileCheck %s -check-prefix=RV32I
4-
; RUN: llc -mtriple=riscv64 -verify-machineinstrs -riscv-enable-sink-fold < %s \
4+
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
55
; RUN: | FileCheck %s -check-prefix=RV64I
66

77
; Check that memory accesses to array elements with large offsets have those

llvm/test/CodeGen/RISCV/srem-vector-lkk.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -mtriple=riscv32 -verify-machineinstrs -riscv-enable-sink-fold < %s \
2+
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
33
; RUN: | FileCheck -check-prefix=RV32I %s
4-
; RUN: llc -mtriple=riscv32 -mattr=+m -verify-machineinstrs -riscv-enable-sink-fold < %s \
4+
; RUN: llc -mtriple=riscv32 -mattr=+m -verify-machineinstrs < %s \
55
; RUN: | FileCheck -check-prefix=RV32IM %s
6-
; RUN: llc -mtriple=riscv64 -verify-machineinstrs -riscv-enable-sink-fold < %s \
6+
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
77
; RUN: | FileCheck -check-prefix=RV64I %s
8-
; RUN: llc -mtriple=riscv64 -mattr=+m -verify-machineinstrs -riscv-enable-sink-fold < %s \
8+
; RUN: llc -mtriple=riscv64 -mattr=+m -verify-machineinstrs < %s \
99
; RUN: | FileCheck -check-prefix=RV64IM %s
1010

1111
define <4 x i16> @fold_srem_vec_1(<4 x i16> %x) nounwind {

llvm/test/CodeGen/RISCV/urem-vector-lkk.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc -mtriple=riscv32 -verify-machineinstrs -riscv-enable-sink-fold < %s \
2+
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
33
; RUN: | FileCheck -check-prefixes=CHECK,RV32I %s
4-
; RUN: llc -mtriple=riscv32 -mattr=+m -verify-machineinstrs -riscv-enable-sink-fold < %s \
4+
; RUN: llc -mtriple=riscv32 -mattr=+m -verify-machineinstrs < %s \
55
; RUN: | FileCheck -check-prefixes=CHECK,RV32IM %s
6-
; RUN: llc -mtriple=riscv64 -verify-machineinstrs -riscv-enable-sink-fold < %s \
6+
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
77
; RUN: | FileCheck -check-prefixes=CHECK,RV64I %s
8-
; RUN: llc -mtriple=riscv64 -mattr=+m -verify-machineinstrs -riscv-enable-sink-fold < %s \
8+
; RUN: llc -mtriple=riscv64 -mattr=+m -verify-machineinstrs < %s \
99
; RUN: | FileCheck -check-prefixes=CHECK,RV64IM %s
1010

1111

0 commit comments

Comments
 (0)