-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Crash in SIInstrInfo::isSafeToSink
#89200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@llvm/issue-subscribers-backend-amdgpu Author: Jay Foad (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 bb.1: bb.2: bb.3:
bb.4: bb.5:
bb.6:
llc: lib/Target/AMDGPU/SIInstrInfo.cpp:220: virtual bool llvm::SIInstrInfo::isSafeToSink(llvm::MachineInstr &, llvm::MachineBasicBlock *, llvm::MachineCycleInfo *) const: Assertion `ExitBlocks[0]->getSinglePredecessor()' failed.
|
I am aware of this, after structurize-cfg, cycle exit block should have exactly one predecessor, but again it could be removed in early-tailduplication I don't know if that block deletion is safe but again since it is late in the pipeline it is probably fine? |
Can you also attach llvm-ir just to check if block was deleted in early-tailduplication |
Here's the IR I used:
|
Sorry. The problem is that when I type |
isSafeToSink needs to check if machine cycle has divergent exit branch but first it needs the MBB that contains cycle exit branch. Early-tailduplication can delete exit block created by structurize-cfg so there is still exactly one cycle exit block but the new cycle exit block can have multiple predecessors. Simplify search for MBBs that contain cycle exit branch by introducing helper method getExitingBlocks in GenericCycle. Fixes #89200
New test case
test/CodeGen/AMDGPU/machine-sink-crash.mir
:I get:
SIInstrInfo::isSafeToSink
was introduced by #67456.Cc @sameerds
The text was updated successfully, but these errors were encountered: