Commit be6f218
committed
[GlobalOpt] Do not promote malloc if there are atomic loads/stores
When converting a malloc stored to a global into a global, we will
introduce an i1 flag to track whether the global has been initialized.
In case of atomic loads/stores, this will result in verifier
failures, because atomic ops on i1 are illegal. Even if we changed
this to i8, I don't think it would be a good idea to change atomic
types in that way.
Instead, bail out of the transform is we encounter any atomic
loads/stores of the global.
Fixes #137152.1 parent 886f119 commit be6f218
File tree
2 files changed
+32
-0
lines changed- llvm
- lib/Transforms/IPO
- test/Transforms/GlobalOpt
2 files changed
+32
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
719 | 719 | | |
720 | 720 | | |
721 | 721 | | |
| 722 | + | |
| 723 | + | |
722 | 724 | | |
723 | 725 | | |
724 | 726 | | |
725 | 727 | | |
| 728 | + | |
| 729 | + | |
726 | 730 | | |
727 | 731 | | |
728 | 732 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments