Issue 202333
Summary [AMDGPU] GCNHazardRecognizer: missing S_NOP after wide store on gfx940/gfx950 (regression in 62b7cf96)
Labels
Assignees
Reporter slariau
    ### Summary

On gfx940/gfx950, a required `S_NOP` after a `global_store_dwordx4` is missing when the store is inside a divergent branch (exec-masked). This causes a WAR hazard. The regression was introduced by commit `62b7cf96` (GCNHazardRecognizer: generalize `checkVALUHazardsHelper`).

### Reproducer

LLVM IR: [test_kernel.ll](https://gist.github.com/slariau/8414a0d57d443eff7a3105b553261f69)

```
llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx950 -O3 test_kernel.ll -o test_kernel.s
```

### Observed vs expected assembly

**After `62b7cf96` (wrong):**
```asm
global_store_dwordx4 v26, v[34:37], s[20:21]
s_or_b64 exec, exec, s[34:35]   ; exec restore after divergent branch
v_pk_mul_f32 ...                 ; WAR hazard: missing S_NOP
```

**Before `62b7cf96` (correct):**
```asm
global_store_dwordx4 v26, v[34:37], s[20:21]
s_or_b64 exec, exec, s[34:35]
s_nop 0                          ; required wait state
v_pk_mul_f32 ...
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to