[all-commits] [llvm/llvm-project] 75c64c: [RISCV] Don't use li+sh3add for constants that can...

Craig Topper via All-commits all-commits at lists.llvm.org
Fri Aug 5 12:47:16 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 75c64c7c4e40ec9bc16d90fee46353628d08d62d
      https://github.com/llvm/llvm-project/commit/75c64c7c4e40ec9bc16d90fee46353628d08d62d
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-08-05 (Fri, 05 Aug 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
    M llvm/test/CodeGen/RISCV/rv32zba.ll
    M llvm/test/CodeGen/RISCV/rv64zba.ll

  Log Message:
  -----------
  [RISCV] Don't use li+sh3add for constants that can use lui+add.

If we're adding a constant that can't use addi we try a few tricks,
one of which is using li+sh3add. We should not do this if lui+add
would work. For example adding 8192. Using sh3add prevents folding
a sext.w to form addw, thus increasing instruction count.




More information about the All-commits mailing list