Skip to content

[RISCV] MachineScheduler.cpp:1368: updatePressureDiffs assertion failure #68730

Open
@preames

Description

@preames

Reduce test case for a crash observed in an LTO build of spec2017 namd. This is a newish failure, but not new. I waited a bit before bothering to reduce this under the hopes that the triggering change would be reverted.

@fpetrogalli I'm guessing this is related to your large rewrite, but haven't yet confirmed that.

$ llc < hand-reduced.ll 
	.text
	.attribute	4, 16
	.attribute	5, "rv64i2p1"
	.file	"<stdin>"
llc: ../llvm-project/llvm/lib/CodeGen/MachineScheduler.cpp:1368: void llvm::ScheduleDAGMILive::updatePressureDiffs(llvm::ArrayRef<llvm::RegisterMaskPair>): Assertion `VNI && "No live value at use."' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /home/preames/llvm-dev/llvm-project/llvm/llc
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'Machine Instruction Scheduler' on function '@test'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  llc       0x0000557d99f08b70 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 240
1  llc       0x0000557d99f05f7f llvm::sys::RunSignalHandlers() + 47
2  llc       0x0000557d99f060d5
3  libc.so.6 0x00007fb8ece42520
4  libc.so.6 0x00007fb8ece969fc pthread_kill + 300
5  libc.so.6 0x00007fb8ece42476 raise + 22
6  libc.so.6 0x00007fb8ece287f3 abort + 211
7  libc.so.6 0x00007fb8ece2871b
8  libc.so.6 0x00007fb8ece39e96
9  llc       0x0000557d992220a6 llvm::ScheduleDAGMILive::updatePressureDiffs(llvm::ArrayRef<llvm::RegisterMaskPair>) + 2038
10 llc       0x0000557d9922e311 llvm::ScheduleDAGMILive::initRegPressure() + 465
11 llc       0x0000557d99233294 llvm::ScheduleDAGMILive::schedule() + 68
12 llc       0x0000557d9921bf3d
13 llc       0x0000557d9922d322
14 llc       0x0000557d991814d7
15 llc       0x0000557d9972ee3e llvm::FPPassManager::runOnFunction(llvm::Function&) + 878
16 llc       0x0000557d9972f089 llvm::FPPassManager::runOnModule(llvm::Module&) + 57
17 llc       0x0000557d9972f9c5 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1061
18 llc       0x0000557d970dea1e
19 llc       0x0000557d97028006 main + 1878
20 libc.so.6 0x00007fb8ece29d90
21 libc.so.6 0x00007fb8ece29e40 __libc_start_main + 128
22 llc       0x0000557d970d5605 _start + 37
Aborted (core dumped)

$ cat hand-reduced.ll 
target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"
target triple = "riscv64-unknown-linux-gnu"

define void @test(i1 %exitcond6351.not) #0 {
entry:
  br label %for.body2902

for.body2987.preheader:                           ; preds = %for.body2902
  %0 = shufflevector <2 x double> %3, <2 x double> zeroinitializer, <8 x i32> <i32 0, i32 poison, i32 poison, i32 1, i32 poison, i32 poison, i32 poison, i32 poison>
  %1 = insertelement <8 x double> %0, double 0.000000e+00, i64 0
  store <8 x double> %0, ptr null, align 8
  br label %delete.end

for.body2902:                                     ; preds = %for.body2902, %entry
  %2 = phi <2 x double> [ %3, %for.body2902 ], [ zeroinitializer, %entry ]
  %3 = fadd <2 x double> zeroinitializer, %2
  br i1 %exitcond6351.not, label %for.body2987.preheader, label %for.body2902

delete.end:                                       ; preds = %for.body2987.preheader
  ret void
}

attributes #0 = { "target-features"="+64bit,+a,+c,+d,+f,+m,+v,,+zvl128b,+zvl256b" }

Metadata

Metadata

Assignees

No one assigned

    Labels

    LTOLink time optimization (regular/full LTO or ThinLTO)backend:RISC-VcrashPrefer [crash-on-valid] or [crash-on-invalid]llvm:codegen

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions