[all-commits] [llvm/llvm-project] ad06e6: [RISCV] Fix the bug in the register allocator caus...

Kai Wang via All-commits all-commits at lists.llvm.org
Thu Jan 20 17:24:19 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ad06e65dc4da45be2cda3e07664502651679622a
      https://github.com/llvm/llvm-project/commit/ad06e65dc4da45be2cda3e07664502651679622a
  Author: Hsiangkai Wang <hsiangkai at google.com>
  Date:   2022-01-21 (Fri, 21 Jan 2022)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
    M llvm/test/CodeGen/RISCV/rvv/emergency-slot.mir
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-calling-conv.ll
    M llvm/test/CodeGen/RISCV/rvv/reg-alloc-reserve-bp.ll
    M llvm/test/CodeGen/RISCV/srem-seteq-illegal-types.ll

  Log Message:
  -----------
  [RISCV] Fix the bug in the register allocator caused by reserved BP.

Originally, hasRVVFrameObject() will scan all the stack objects to check
whether if there is any scalable vector object on the stack or not.
However, it causes errors in the register allocator. In issue 53016, it
returns false before RA because there is no RVV stack objects. After RA,
it returns true because there are spilling slots for RVV values during RA.
The compiler will not reserve BP during register allocation and generate BP
access in the PEI pass due to the inconsistent behavior of the function.

The function is changed to use hasStdExtV() as the return value. It is
not precise, but it can make the register allocation correct.

Refer to https://github.com/llvm/llvm-project/issues/53016.

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




More information about the All-commits mailing list