Commit 6aed1a5
committed
AMDGPU: Stop emitting an error on illegal addrspacecasts (llvm#127487)
These cannot be static compile errors, and should be treated as
poison. Invalid casts may be introduced which are dynamically dead.
For example:
```
void foo(volatile generic int* x) {
__builtin_assume(is_shared(x));
*x = 4;
}
void bar() {
private int y;
foo(&y); // violation, wrong address space
}
```
This could produce a compile time backend error or not depending on
the optimization level. Similarly, the new test demonstrates a failure
on a lowered atomicrmw which required inserting runtime address
space checks. The invalid cases are dynamically dead, we should not
error, and the AtomicExpand pass shouldn't have to consider the details
of the incoming pointer to produce valid IR.
This should go to the release branch. This fixes broken -O0 compiles
with 64-bit atomics which would have started failing in
1d03708.
(cherry picked from commit 18ea6c9)1 parent 0429535 commit 6aed1a5
File tree
4 files changed
+687
-17
lines changed- llvm
- lib/Target/AMDGPU
- test/CodeGen/AMDGPU
4 files changed
+687
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2426 | 2426 | | |
2427 | 2427 | | |
2428 | 2428 | | |
2429 | | - | |
2430 | | - | |
2431 | | - | |
2432 | | - | |
2433 | | - | |
| 2429 | + | |
| 2430 | + | |
2434 | 2431 | | |
2435 | 2432 | | |
2436 | 2433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7340 | 7340 | | |
7341 | 7341 | | |
7342 | 7342 | | |
7343 | | - | |
7344 | | - | |
7345 | | - | |
7346 | | - | |
7347 | | - | |
| 7343 | + | |
| 7344 | + | |
7348 | 7345 | | |
7349 | 7346 | | |
7350 | 7347 | | |
| |||
0 commit comments