[all-commits] [llvm/llvm-project] 5baf58: [RISCV] Improve use of BSETI/BCLRI in constant mat...

Craig Topper via All-commits all-commits at lists.llvm.org
Wed May 8 21:53:37 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5baf58b628a4488de3f1a6af7c0df180358ba5dc
      https://github.com/llvm/llvm-project/commit/5baf58b628a4488de3f1a6af7c0df180358ba5dc
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2024-05-08 (Wed, 08 May 2024)

  Changed paths:
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp
    M llvm/test/CodeGen/RISCV/imm.ll
    M llvm/test/CodeGen/RISCV/rv64-legal-i32/imm.ll

  Log Message:
  -----------
  [RISCV] Improve use of BSETI/BCLRI in constant materialization. (#91546)

We failed to use BSETI when bit 31 was set and a few bits above bit 31
were set. We also failed to use multiple BSETI when the low 32 bits were
zero.

I've removed the special cases for constants 0x80000000-0xffffffff and
wrote a more generic algorithm for BSETI.

I've rewritten the BCLRI handling to be similar to the new BSETI
algorithm. This picks up cases where bit 31 is 0 and only a few high
bits are 0.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list