[all-commits] [llvm/llvm-project] a2b905: [RISCV] Reduce size of CSR lookup tables. NFC (#12...

Craig Topper via All-commits all-commits at lists.llvm.org
Fri Jan 3 19:04:35 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a2b9058c392995660956e56c2ac8695a44dc2e4e
      https://github.com/llvm/llvm-project/commit/a2b9058c392995660956e56c2ac8695a44dc2e4e
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2025-01-03 (Fri, 03 Jan 2025)

  Changed paths:
    M llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
    M llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp
    M llvm/lib/Target/RISCV/RISCVSystemOperands.td

  Log Message:
  -----------
  [RISCV] Reduce size of CSR lookup tables. NFC (#121606)

Instead of storing 3 different names in each row of the table, use a
separate row for each name and use a flag to indicate what type of name
it is. The AltName and DeprecatedName weren't used often enough to
justify storing them as a possibility for every register.

This reduces the .rodata size by 27k and reduces the number of dynamic
relocations since we now only need 1 lookup by name function. The lookup
by name function each contained a ~400 entry table of const char*
pointing to constant strings. Each of those requires a dynamic
relocation.

I also capitalized IsRV32Only in the C++ code to match coding
standards.



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