[AMDGPU] Assertion failure in fixVALUMaskWriteHazard
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
With this test case:
```
; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize64 < %s
define amdgpu_cs i32 @main(i32 %arg, i32 %arg1) {
bb:
%i = udiv i32 %arg, %arg1
%i2 = uitofp i32 %i to float
%i3 = udiv i32 1, %arg
%i4 = uitofp i32 %i3 to float
%i5 = call float @llvm.fma.f32(float %i2, float 0.000000e+00, float %i4)
%i6 = fptosi float %i5 to i32
%i7 = call i32 @func(i32 0, i32 %i6)
ret i32 %i7
}
declare i32 @func(i32, i32)
```
I get:
```
$ llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+wavefrontsize64 < r.ll
llc: include/llvm/CodeGen/MachineInstrBundleIterator.h:135: llvm::MachineInstrBundleIterator::MachineInstrBundleIterator(instr_iterator) [Ty = llvm::MachineInstr, IsReverse = true]: Assertion `(!MI.getNodePtr() || MI.isEnd() || !MI->isBundledWithPred()) && "It's not legal to initialize MachineInstrBundleIterator with a " "bundled MI"' failed.
```
Contributor guide
Research direction
Start by running the provided llc command with the embedded AMDGPU IR and inspect fixVALUMaskWriteHazard, named in the title. Read include/llvm/CodeGen/MachineInstrBundleIterator.h around the reported assertion to understand the bundled-instruction failure. Done means the reproducer no longer triggers the assertion, with a regression test covering it.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100