Commit bd4cc70
committed
[IR] Add
Introduce `dead_on_return` attribute, which is meant to be taken
advantage by the frontend, and states that the memory pointed to
by the argument is dead upon function return. As with `byval`,
it is supposed to be used for passing aggregates by value. The
difference lies in the ABI: `byval` implies that the pointer is
explicitly passed as argument to the callee (during codegen the
copy is emitted as per byval contract), whereas a `dead_on_return`
-marked argument may imply that the copy already exists at the IR
level, is located at a specific stack offset within the caller,
and this memory will not be read further by the caller upon callee
return – or otherwise poison, if read before being written.dead_on_return attribute1 parent 0e2103a commit bd4cc70
File tree
13 files changed
+63
-7
lines changed- llvm
- docs
- include/llvm
- Bitcode
- IR
- lib
- Bitcode
- Reader
- Writer
- IR
- Transforms
- Scalar
- Utils
- test
- Bitcode
- Transforms/DeadStoreElimination
- Verifier
13 files changed
+63
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1741 | 1741 | | |
1742 | 1742 | | |
1743 | 1743 | | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
1744 | 1761 | | |
1745 | 1762 | | |
1746 | 1763 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
798 | 798 | | |
799 | 799 | | |
800 | 800 | | |
| 801 | + | |
801 | 802 | | |
802 | 803 | | |
803 | 804 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| |||
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
201 | 204 | | |
202 | 205 | | |
203 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2246 | 2246 | | |
2247 | 2247 | | |
2248 | 2248 | | |
| 2249 | + | |
| 2250 | + | |
2249 | 2251 | | |
2250 | 2252 | | |
2251 | 2253 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
940 | 940 | | |
941 | 941 | | |
942 | 942 | | |
| 943 | + | |
| 944 | + | |
943 | 945 | | |
944 | 946 | | |
945 | 947 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2424 | 2424 | | |
2425 | 2425 | | |
2426 | 2426 | | |
2427 | | - | |
| 2427 | + | |
| 2428 | + | |
2428 | 2429 | | |
2429 | 2430 | | |
2430 | 2431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
1020 | | - | |
1021 | | - | |
| 1020 | + | |
| 1021 | + | |
1022 | 1022 | | |
1023 | | - | |
| 1023 | + | |
1024 | 1024 | | |
1025 | 1025 | | |
1026 | 1026 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1025 | 1025 | | |
1026 | 1026 | | |
1027 | 1027 | | |
| 1028 | + | |
1028 | 1029 | | |
1029 | 1030 | | |
1030 | 1031 | | |
| |||
0 commit comments