[all-commits] [llvm/llvm-project] 0e6c15: [RISCV] Optimization for using compressed beqz and...

ita-sc via All-commits all-commits at lists.llvm.org
Thu Oct 6 09:34:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0e6c1576e6716832f7a0f18183fdfb92340f42e6
      https://github.com/llvm/llvm-project/commit/0e6c1576e6716832f7a0f18183fdfb92340f42e6
  Author: Ivan Tetyushkin <ivan.tetyushkin at syntacore.com>
  Date:   2022-10-06 (Thu, 06 Oct 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVInstrInfo.td
    A llvm/test/CodeGen/RISCV/compress-opt-branch.ll
    A llvm/test/CodeGen/RISCV/compress-opt-select.ll

  Log Message:
  -----------
  [RISCV] Optimization for using compressed beqz and bnez PR#56391

Optimization for using compressed beqz and bnez

If there is pattern
```
br_cc val1 constval eq/neq place
select_cc val1 constval eq/neq trueval falseval
```
and constval does not fit in compressed imm format(6 bit), but fit in
imm format(12 bit), we can replace by non compress sub and compress
c.beqz/c.bneqz:

```
addi val val -constval
c.beqz val place
```

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D132839




More information about the All-commits mailing list