[all-commits] [llvm/llvm-project] 9aa20c: [RISCV] Improve register allocation around vector ...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Sat Feb 20 06:54:20 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9aa20caee6b47ac601602c674749fb6c1d2179cf
      https://github.com/llvm/llvm-project/commit/9aa20caee6b47ac601602c674749fb6c1d2179cf
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2021-02-20 (Sat, 20 Feb 2021)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
    M llvm/lib/Target/RISCV/RISCVRegisterInfo.h
    M llvm/test/CodeGen/RISCV/rvv/mask-reg-alloc.mir

  Log Message:
  -----------
  [RISCV] Improve register allocation around vector masks

With vector mask registers only allocatable to V0 (VMV0Regs) it is
relatively simple to generate code which uses multiple masks and naively
requires spilling.

This patch aims to improve codegen in such cases by telling LLVM it can
use VRRegs to hold masks. This will prevent spilling in many cases by
having LLVM copy to an available VR register.

Reviewed By: craig.topper

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




More information about the All-commits mailing list