<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/68730>68730</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [RISCV] MachineScheduler.cpp:1368: updatePressureDiffs assertion failure
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          preames
      </td>
    </tr>
</table>

<pre>
    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" }
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8WFtv2zo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