Skip to content

Crash in SIInstrInfo::isSafeToSink #89200

Closed
@jayfoad

Description

@jayfoad

New test case test/CodeGen/AMDGPU/machine-sink-crash.mir:

# RUN: llc -mtriple=amdgcn -mcpu=gfx1030 -run-pass=machine-sink %s | FileCheck %s

---
name: f
body: |
  bb.0:
    %81:sreg_32_xm0_xexec = IMPLICIT_DEF
    S_CBRANCH_SCC1 %bb.2, implicit undef $scc
    S_BRANCH %bb.1
  
  bb.1:
    S_BRANCH %bb.3
  
  bb.2:
    S_BRANCH %bb.6
  
  bb.3:
    successors: %bb.4, %bb.5
  
    %10:sreg_32_xm0_xexec = SI_IF undef %81, %bb.5, implicit-def $exec, implicit-def $scc, implicit $exec
    S_BRANCH %bb.4
  
  bb.4:
  
  bb.5:
    successors: %bb.2(0x00000000), %bb.3(0x80000000)
  
    %61:sreg_32 = COPY undef %10
    S_CBRANCH_VCCNZ %bb.3, implicit undef $vcc
    S_BRANCH %bb.2
  
  bb.6:
    ADJCALLSTACKUP 0, 0, implicit-def $scc
    ADJCALLSTACKDOWN 0, 0, implicit-def $scc
...

I get:

llc: lib/Target/AMDGPU/SIInstrInfo.cpp:220: virtual bool llvm::SIInstrInfo::isSafeToSink(llvm::MachineInstr &, llvm::MachineBasicBlock *, llvm::MachineCycleInfo *) const: Assertion `ExitBlocks[0]->getSinglePredecessor()' failed.

SIInstrInfo::isSafeToSink was introduced by #67456.

Cc @sameerds

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions