Skip to content

Commit 7a77127

Browse files
authored
[RISCV] Ignore debug instructions in RISCVVLOptimizer (#159616)
Don't put them onto the worklist, since they'll crash when we try to check their opcode. Fixes #159422
1 parent 5a873d3 commit 7a77127

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,8 @@ bool RISCVVLOptimizer::runOnMachineFunction(MachineFunction &MF) {
16651665
for (MachineBasicBlock *MBB : post_order(&MF)) {
16661666
assert(MDT->isReachableFromEntry(MBB));
16671667
for (MachineInstr &MI : reverse(*MBB))
1668-
Worklist.insert(&MI);
1668+
if (!MI.isDebugInstr())
1669+
Worklist.insert(&MI);
16691670
}
16701671

16711672
while (!Worklist.empty()) {

llvm/test/CodeGen/RISCV/rvv/vl-opt.mir

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,3 +770,11 @@ body: |
770770
bb.2:
771771
PseudoVSE8_V_M1 %inc, $noreg, %avl2, 3 /* e8 */
772772
...
773+
---
774+
name: dbg_value
775+
body: |
776+
bb.0:
777+
; CHECK-LABEL: name: dbg_value
778+
; CHECK: DBG_VALUE %0:vr
779+
DBG_VALUE %0:vr
780+
...

0 commit comments

Comments
 (0)