llvm / llvm/llvm-project

[AMDGPU] CodeGen regressions after #154336

Open
#164,779 3 comments 0 reactions 0 assignees View on GitHub
backend:AMDGPU
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

#154336 causes performance regressions in a few of our graphics benchmarks. From staring at some large before-and-after shader dumps it seems that the slower shaders simply have more computational instructions in them (v_mul_f32, v_fme_f32 and similar). I tried automatically reducing a test case and came up with: [r.txt](https://github.com/user-attachments/files/23094138/r.txt)
```
$ opt -S -p=instcombine,scalarizer,instcombine < r.txt
```
Before #154336, all the math is removed and the function just returns `poison`. After #154336, none of the math is removed.

Contributor guide

Open the contributing guide

Research direction

Start with the attached r.txt reproducer and run `opt -S -p=instcombine,scalarizer,instcombine < r.txt` to compare behavior before and after #154336. Trace why the math is no longer removed and verify that the reduced function again returns `poison` without the extra computational instructions.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.