Commit c6973ad
authored
[Mem2Reg] Generate non-terminator unreachable for !noundef undef (#96639)
When performing a load from uninitialized memory using !noundef, insert
a non-terminator unreachable instruction, which will be converted to a
proper unreachable by SimplifyCFG. This way we retain the fact that UB
occurred on this code path.1 parent fb463e1 commit c6973ad
File tree
2 files changed
+15
-6
lines changed- llvm
- lib/Transforms/Utils
- test/Transforms/Mem2Reg
2 files changed
+15
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
456 | 465 | | |
457 | 466 | | |
458 | 467 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| 160 | + | |
159 | 161 | | |
160 | 162 | | |
| 163 | + | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| |||
176 | 179 | | |
177 | 180 | | |
178 | 181 | | |
179 | | - | |
180 | | - | |
| 182 | + | |
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
| |||
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
194 | | - | |
195 | | - | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
0 commit comments