Skip to content

Commit 0a6a40d

Browse files
committed
[RISCV] Add Zca predicate to BrccCompressOpt patterns used for MinSize.
Previously we only checked for C.
1 parent e7e7827 commit 0a6a40d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ defm : BccPat<SETGE, BGE>;
14191419
defm : BccPat<SETULT, BLTU>;
14201420
defm : BccPat<SETUGE, BGEU>;
14211421

1422-
let Predicates = [HasStdExtC, OptForMinSize] in {
1422+
let Predicates = [HasStdExtCOrZca, OptForMinSize] in {
14231423
def : BrccCompressOpt<SETEQ, BEQ>;
14241424
def : BrccCompressOpt<SETNE, BNE>;
14251425
}

llvm/test/CodeGen/RISCV/compress-opt-branch.ll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
; RUN: | llvm-objdump -d --triple=riscv32 --mattr=+c,+f,+d -M no-aliases - \
99
; RUN: | FileCheck -check-prefix=RV32IFDC %s
1010
;
11+
; RUN: llc -mtriple=riscv32 -target-abi ilp32d -mattr=+zca,+f,+d -filetype=obj \
12+
; RUN: -disable-block-placement < %s \
13+
; RUN: | llvm-objdump -d --triple=riscv32 --mattr=+zca,+f,+d -M no-aliases - \
14+
; RUN: | FileCheck -check-prefix=RV32IFDC %s
15+
;
1116
; RUN: llc -mtriple=riscv32 -target-abi ilp32d -mattr=-c,+f,+d -filetype=obj \
1217
; RUN: -disable-block-placement < %s \
1318
; RUN: | llvm-objdump -d --triple=riscv32 --mattr=-c,+f,+d -M no-aliases - \

0 commit comments

Comments
 (0)