Commit 0da8d0f
authored
[AMDGPU] Change handling of unsupported non-compute shaders with HSA (llvm#126798)
Previous handling in `SITargetLowering::LowerFormalArguments` only
reported a diagnostic message and continued execution by returning a
non-usable `SDValue`. This results in llvm crashing later with an
unrelated error. This commit changes the detection of an unsupported
non-compute shader to be a fatal error right away.
As an example situation, take the usage of an `amdgpu_ps` function and
the `amdgcn-unknown-amdhsa` target triple.
```
define amdgpu_ps void @foo(ptr %p, i32 %i) {
store i32 %i, ptr %p
ret void
}
```
Compiling this code (with `llc -mtriple=amdgcn-unknown-amdhsa
-mcpu=gfx942`, for example) fails with:
```
error: <unknown>:0:0: in function foo void (ptr, i32): unsupported non-compute shaders with HSA
llc:
[...]/git/trunk21.0/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:11790:
void llvm::SelectionDAGISel::LowerArguments(const llvm::Function&):
Assertion `InVals.size() == Ins.size() && "LowerFormalArguments didn't emit the correct number of values!"' failed.
[...]
```1 parent d2240cd commit 0da8d0f
File tree
2 files changed
+58
-11
lines changed- llvm
- lib/Target/AMDGPU
- test/CodeGen/AMDGPU
2 files changed
+58
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2822 | 2822 | | |
2823 | 2823 | | |
2824 | 2824 | | |
| 2825 | + | |
2825 | 2826 | | |
2826 | 2827 | | |
2827 | 2828 | | |
2828 | 2829 | | |
2829 | 2830 | | |
2830 | | - | |
| 2831 | + | |
2831 | 2832 | | |
2832 | 2833 | | |
2833 | 2834 | | |
| |||
2936 | 2937 | | |
2937 | 2938 | | |
2938 | 2939 | | |
2939 | | - | |
| 2940 | + | |
2940 | 2941 | | |
2941 | 2942 | | |
2942 | 2943 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
5 | 25 | | |
6 | 26 | | |
7 | 27 | | |
8 | | - | |
9 | | - | |
| 28 | + | |
| 29 | + | |
10 | 30 | | |
11 | 31 | | |
12 | 32 | | |
13 | | - | |
14 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
15 | 36 | | |
16 | 37 | | |
17 | 38 | | |
18 | | - | |
19 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
0 commit comments