Commit 2e53a68
authored
[flang][runtime] Speed up initialization & destruction (llvm#148087)
Rework derived type initialization in the runtime to just initialize the
first element of any array, and then memcpy it to the others, rather
than exercising the per-component paths for each element.
Reword derived type destruction in the runtime to detect and exploit a
fast path for allocatable components whose types themselves don't need
nested destruction.
Small tweaks were made in hot paths exposed by profiling in descriptor
operations and derived type assignment.1 parent 18286e0 commit 2e53a68
File tree
8 files changed
+241
-157
lines changed- flang-rt
- include/flang-rt/runtime
- lib/runtime
8 files changed
+241
-157
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
262 | 265 | | |
263 | 266 | | |
264 | 267 | | |
265 | | - | |
266 | | - | |
267 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
268 | 282 | | |
269 | 283 | | |
270 | 284 | | |
| |||
366 | 380 | | |
367 | 381 | | |
368 | 382 | | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
369 | 395 | | |
370 | 396 | | |
371 | 397 | | |
| |||
377 | 403 | | |
378 | 404 | | |
379 | 405 | | |
380 | | - | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
381 | 422 | | |
382 | 423 | | |
383 | 424 | | |
| |||
392 | 433 | | |
393 | 434 | | |
394 | 435 | | |
395 | | - | |
396 | | - | |
| 436 | + | |
397 | 437 | | |
398 | 438 | | |
399 | 439 | | |
| |||
406 | 446 | | |
407 | 447 | | |
408 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
409 | 475 | | |
410 | 476 | | |
411 | 477 | | |
| |||
427 | 493 | | |
428 | 494 | | |
429 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
430 | 504 | | |
431 | 505 | | |
432 | 506 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
136 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
140 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
141 | 150 | | |
142 | 151 | | |
143 | 152 | | |
| |||
146 | 155 | | |
147 | 156 | | |
148 | 157 | | |
149 | | - | |
| 158 | + | |
150 | 159 | | |
151 | | - | |
152 | 160 | | |
153 | 161 | | |
154 | 162 | | |
155 | 163 | | |
156 | 164 | | |
157 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
158 | 173 | | |
159 | 174 | | |
160 | 175 | | |
| |||
230 | 245 | | |
231 | 246 | | |
232 | 247 | | |
233 | | - | |
| 248 | + | |
234 | 249 | | |
235 | | - | |
| 250 | + | |
236 | 251 | | |
237 | 252 | | |
238 | 253 | | |
239 | 254 | | |
240 | | - | |
| 255 | + | |
241 | 256 | | |
242 | 257 | | |
243 | 258 | | |
| |||
285 | 300 | | |
286 | 301 | | |
287 | 302 | | |
288 | | - | |
| 303 | + | |
| 304 | + | |
289 | 305 | | |
290 | 306 | | |
291 | 307 | | |
292 | 308 | | |
293 | 309 | | |
| 310 | + | |
294 | 311 | | |
295 | 312 | | |
296 | 313 | | |
| |||
304 | 321 | | |
305 | 322 | | |
306 | 323 | | |
| 324 | + | |
307 | 325 | | |
308 | 326 | | |
309 | 327 | | |
310 | 328 | | |
311 | | - | |
312 | 329 | | |
313 | 330 | | |
314 | 331 | | |
| |||
552 | 569 | | |
553 | 570 | | |
554 | 571 | | |
| 572 | + | |
555 | 573 | | |
556 | 574 | | |
557 | 575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
221 | | - | |
| 220 | + | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
439 | 442 | | |
440 | 443 | | |
441 | 444 | | |
| |||
529 | 532 | | |
530 | 533 | | |
531 | 534 | | |
532 | | - | |
| 535 | + | |
533 | 536 | | |
534 | 537 | | |
535 | 538 | | |
| |||
544 | 547 | | |
545 | 548 | | |
546 | 549 | | |
547 | | - | |
| 550 | + | |
548 | 551 | | |
549 | 552 | | |
550 | 553 | | |
| |||
615 | 618 | | |
616 | 619 | | |
617 | 620 | | |
618 | | - | |
| 621 | + | |
619 | 622 | | |
620 | 623 | | |
621 | 624 | | |
| |||
648 | 651 | | |
649 | 652 | | |
650 | 653 | | |
651 | | - | |
| 654 | + | |
652 | 655 | | |
653 | 656 | | |
654 | 657 | | |
| |||
670 | 673 | | |
671 | 674 | | |
672 | 675 | | |
673 | | - | |
674 | 676 | | |
675 | 677 | | |
676 | 678 | | |
677 | 679 | | |
| 680 | + | |
678 | 681 | | |
679 | 682 | | |
680 | 683 | | |
| |||
727 | 730 | | |
728 | 731 | | |
729 | 732 | | |
730 | | - | |
731 | | - | |
| 733 | + | |
| 734 | + | |
732 | 735 | | |
733 | 736 | | |
734 | 737 | | |
735 | 738 | | |
736 | 739 | | |
737 | | - | |
738 | | - | |
| 740 | + | |
| 741 | + | |
739 | 742 | | |
740 | 743 | | |
741 | 744 | | |
| |||
0 commit comments