Commit aec2f3b
committed
[InstSimplify] Correctly handle comparison with zero-size allocs
InstSimplify currently folds alloc1 == alloc2 to false, even if
one of them is a zero-size allocation. A zero-size allocation may
have the same address as another allocation.
This also disables the fold for the case where we're comparing a
zero-size alloc with the middle of another allocation. It's
possible that this case is legal to fold depending on our precise
zero-size allocation semantics, but LangRef currently doesn't
specify this either way, so we shouldn't make assumptions here.1 parent 3fcb968 commit aec2f3b
File tree
2 files changed
+12
-6
lines changed- llvm
- lib/Analysis
- test/Transforms/InstSimplify
2 files changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2774 | 2774 | | |
2775 | 2775 | | |
2776 | 2776 | | |
2777 | | - | |
2778 | | - | |
| 2777 | + | |
| 2778 | + | |
2779 | 2779 | | |
2780 | 2780 | | |
2781 | 2781 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
237 | 238 | | |
238 | | - | |
| 239 | + | |
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
| |||
249 | 250 | | |
250 | 251 | | |
251 | 252 | | |
| 253 | + | |
| 254 | + | |
252 | 255 | | |
253 | | - | |
| 256 | + | |
254 | 257 | | |
255 | 258 | | |
256 | 259 | | |
| |||
282 | 285 | | |
283 | 286 | | |
284 | 287 | | |
| 288 | + | |
285 | 289 | | |
286 | | - | |
| 290 | + | |
287 | 291 | | |
288 | 292 | | |
289 | 293 | | |
| |||
295 | 299 | | |
296 | 300 | | |
297 | 301 | | |
| 302 | + | |
| 303 | + | |
298 | 304 | | |
299 | | - | |
| 305 | + | |
300 | 306 | | |
301 | 307 | | |
302 | 308 | | |
| |||
0 commit comments