[llvm] 0a6a40d - [RISCV] Add Zca predicate to BrccCompressOpt patterns used for MinSize.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 5 12:44:22 PDT 2024
Author: Craig Topper
Date: 2024-04-05T12:39:39-07:00
New Revision: 0a6a40d62ed338eb3aa57bfee83d958521542fba
URL: https://github.com/llvm/llvm-project/commit/0a6a40d62ed338eb3aa57bfee83d958521542fba
DIFF: https://github.com/llvm/llvm-project/commit/0a6a40d62ed338eb3aa57bfee83d958521542fba.diff
LOG: [RISCV] Add Zca predicate to BrccCompressOpt patterns used for MinSize.
Previously we only checked for C.
Added:
Modified:
llvm/lib/Target/RISCV/RISCVInstrInfo.td
llvm/test/CodeGen/RISCV/compress-opt-branch.ll
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.td b/llvm/lib/Target/RISCV/RISCVInstrInfo.td
index fd8777fdc121c7..2cfad7f7c06110 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfo.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.td
@@ -1419,7 +1419,7 @@ defm : BccPat<SETGE, BGE>;
defm : BccPat<SETULT, BLTU>;
defm : BccPat<SETUGE, BGEU>;
-let Predicates = [HasStdExtC, OptForMinSize] in {
+let Predicates = [HasStdExtCOrZca, OptForMinSize] in {
def : BrccCompressOpt<SETEQ, BEQ>;
def : BrccCompressOpt<SETNE, BNE>;
}
diff --git a/llvm/test/CodeGen/RISCV/compress-opt-branch.ll b/llvm/test/CodeGen/RISCV/compress-opt-branch.ll
index 44eaf4bdc207e7..f740e7fc4e3135 100644
--- a/llvm/test/CodeGen/RISCV/compress-opt-branch.ll
+++ b/llvm/test/CodeGen/RISCV/compress-opt-branch.ll
@@ -8,6 +8,11 @@
; RUN: | llvm-objdump -d --triple=riscv32 --mattr=+c,+f,+d -M no-aliases - \
; RUN: | FileCheck -check-prefix=RV32IFDC %s
;
+; RUN: llc -mtriple=riscv32 -target-abi ilp32d -mattr=+zca,+f,+d -filetype=obj \
+; RUN: -disable-block-placement < %s \
+; RUN: | llvm-objdump -d --triple=riscv32 --mattr=+zca,+f,+d -M no-aliases - \
+; RUN: | FileCheck -check-prefix=RV32IFDC %s
+;
; RUN: llc -mtriple=riscv32 -target-abi ilp32d -mattr=-c,+f,+d -filetype=obj \
; RUN: -disable-block-placement < %s \
; RUN: | llvm-objdump -d --triple=riscv32 --mattr=-c,+f,+d -M no-aliases - \
More information about the llvm-commits
mailing list