Commit 9d34b67
authored
[InstSimplify] Fold ptrtoint(ptradd(P,X-ptrtoint(P))) to X (#98649)
This is a special case of the general ptrtoint(gep) to add(ptrtoint)
transform that is particularly profitable, as everything folds away.
Proof: https://alive2.llvm.org/ce/z/fwv8_L
Fixes #86417.1 parent 297fab1 commit 9d34b67
File tree
2 files changed
+10
-10
lines changed- llvm
- lib/Analysis
- test/Transforms/InstSimplify
2 files changed
+10
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5333 | 5333 | | |
5334 | 5334 | | |
5335 | 5335 | | |
| 5336 | + | |
| 5337 | + | |
| 5338 | + | |
| 5339 | + | |
| 5340 | + | |
| 5341 | + | |
| 5342 | + | |
| 5343 | + | |
5336 | 5344 | | |
5337 | 5345 | | |
5338 | 5346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
12 | 8 | | |
13 | 9 | | |
14 | 10 | | |
| |||
20 | 16 | | |
21 | 17 | | |
22 | 18 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 19 | + | |
28 | 20 | | |
29 | 21 | | |
30 | 22 | | |
| |||
0 commit comments