Commit 510fb87
authored
[IR][TLI] Cache getLibFunc() result on Function (NFC) (#72867)
Cache the result of the TLI libfunc lookup in the Function object. This only caches the actual lookup of the LibFunc in the TLI map, but not the prototype validation, as that might differ between different TLI instances. This uses the existing mechanism for invalidating the intrinsic ID when the function name changes. The libfunc will be invalidated in that case as well. I don't believe this increases the size of Function on 64bit (which currently has a trailing `bool` member), and I don't think we would particularly care if it did, as Functions are uncommon as Values go.1 parent 74cdb8e commit 510fb87
File tree
4 files changed
+26
-8
lines changed- llvm
- include/llvm/IR
- lib
- Analysis
- IR
4 files changed
+26
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| |||
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
123 | 134 | | |
124 | 135 | | |
125 | 136 | | |
| |||
239 | 250 | | |
240 | 251 | | |
241 | 252 | | |
242 | | - | |
243 | | - | |
244 | | - | |
| 253 | + | |
| 254 | + | |
245 | 255 | | |
246 | 256 | | |
247 | | - | |
| 257 | + | |
248 | 258 | | |
249 | 259 | | |
250 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
1141 | | - | |
1142 | | - | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1143 | 1150 | | |
1144 | 1151 | | |
1145 | 1152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
915 | | - | |
| 915 | + | |
| 916 | + | |
916 | 917 | | |
917 | 918 | | |
918 | 919 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | | - | |
| 380 | + | |
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| |||
0 commit comments