Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
5 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
# RUN: llc -march=riscv64 -mattr=+experimental-v -o - %s \ | ||
# RUN: -stop-after=prologepilog | FileCheck %s | ||
|
||
--- | | ||
define void @foo() !dbg !0 { | ||
entry: | ||
%va = alloca <vscale x 2 x i32>, align 4, !dbg !1 | ||
br label %end | ||
end: | ||
ret void, !dbg !2 | ||
} | ||
|
||
!0 = distinct !DISubprogram(name: "foo", line: 3, scopeLine: 3) | ||
!1 = !DILocation(line: 4, column: 14, scope: !0) | ||
!2 = !DILocation(line: 5, column: 3, scope: !0) | ||
|
||
... | ||
--- | ||
name: foo | ||
tracksRegLiveness: true | ||
stack: | ||
- { id: 0, stack-id: scalable-vector, offset: 0, size: 8, alignment: 8 } | ||
body: | | ||
; CHECK-LABEL: name: foo | ||
; CHECK: bb.0: | ||
; CHECK: successors: %bb.1(0x80000000) | ||
; CHECK: $x2 = frame-setup ADDI $x2, -16 | ||
; CHECK: CFI_INSTRUCTION def_cfa_offset 16 | ||
; CHECK: $x10 = PseudoReadVLENB | ||
; CHECK: $x10 = SLLI killed $x10, 1 | ||
; CHECK: $x2 = SUB $x2, killed $x10 | ||
; CHECK: bb.1: | ||
; CHECK: $x10 = PseudoReadVLENB | ||
; CHECK: $x10 = SLLI killed $x10, 1 | ||
; CHECK: $x2 = ADD $x2, killed $x10 | ||
; CHECK: $x2 = frame-destroy ADDI $x2, 16 | ||
; CHECK: PseudoRET | ||
bb.0: | ||
bb.1: | ||
PseudoRET |