Commit 2b9d44d
[InstCombine] Combine ptrauth intrin. callee into diff. key bundle.
Try to optimize a call to the result of a ptrauth intrinsic, potentially
into the ptrauth call bundle:
- call(ptrauth.resign(p)), ["ptrauth"()] -> call p, ["ptrauth"()]
- call(ptrauth.sign(p)), ["ptrauth"()] -> call p
- call(ptrauth.auth(p)) -> call p, ["ptrauth"()]
as long as the key/discriminator are the same in sign and auth-bundle.
This relaxes the existing combine in one major way: it can generate calls
with ptrauth bundles with a different key from the existing call.
Without knowledge of the target keys, this may be unsound.
That also allows folding ptrauth.auth into the call bundle: we can't
generally do that if we don't know whether the auth key is valid for
calls.1 parent 34cd03c commit 2b9d44d
File tree
3 files changed
+31
-13
lines changed- llvm
- lib/Transforms/InstCombine
- test/Transforms/InstCombine
3 files changed
+31
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3982 | 3982 | | |
3983 | 3983 | | |
3984 | 3984 | | |
3985 | | - | |
3986 | | - | |
3987 | | - | |
3988 | | - | |
3989 | 3985 | | |
3990 | 3986 | | |
3991 | 3987 | | |
| |||
4003 | 3999 | | |
4004 | 4000 | | |
4005 | 4001 | | |
| 4002 | + | |
| 4003 | + | |
| 4004 | + | |
| 4005 | + | |
| 4006 | + | |
| 4007 | + | |
| 4008 | + | |
| 4009 | + | |
| 4010 | + | |
| 4011 | + | |
4006 | 4012 | | |
4007 | 4013 | | |
4008 | 4014 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | | - | |
| 287 | + | |
| 288 | + | |
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| |||
Lines changed: 19 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
50 | 62 | | |
51 | 63 | | |
52 | 64 | | |
| |||
0 commit comments