[all-commits] [llvm/llvm-project] b41e13: [RISCV] Add the DebugLoc parameter to getVLENFacto...

Kai Wang via All-commits all-commits at lists.llvm.org
Fri May 14 06:31:38 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b41e1306b80f20a857f0e285e51ea453eb7888a1
      https://github.com/llvm/llvm-project/commit/b41e1306b80f20a857f0e285e51ea453eb7888a1
  Author: Hsiangkai Wang <kai.wang at sifive.com>
  Date:   2021-05-14 (Fri, 14 May 2021)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVFrameLowering.cpp
    M llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
    M llvm/lib/Target/RISCV/RISCVInstrInfo.h
    M llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
    A llvm/test/CodeGen/RISCV/rvv/get-vlen-debugloc.mir

  Log Message:
  -----------
  [RISCV] Add the DebugLoc parameter to getVLENFactoredAmount().

The MachineBasicBlock::iterator is continuously changing during
generating the frame handling instructions. We should use the DebugLoc
from the caller, instead of getting it from the changing iterator.

If the prologue instructions located in a basic block without any other
instructions after these prologue instructions, the iterator will be
updated to the boundary of the basic block and it is invalid to use the
iterator to access DebugLoc. This patch also fixes the crash when
accessing DebugLoc using the iterator.

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




More information about the All-commits mailing list