forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit37d5bab
committed
jit: Support opaque pointers in LLVM 16.
Remove use of LLVMGetElementType() and provide the type of all pointersto LLVMBuildXXX() functions when emitting IR, as required by modern LLVMversions[1]. * For LLVM <= 14, we'll still use the old LLVMBuildXXX() functions. * For LLVM == 15, we'll continue to do the same, explicitly opting out of opaque pointer mode. * For LLVM >= 16, we'll use the new LLVMBuildXXX2() functions that take the extra type argument.The difference is hidden behind some new IR emitting wrapper functionsl_load(), l_gep(), l_call() etc. The change is mostly mechanical,except that at each site the correct type had to be provided.In some places we needed to do some extra work to get functions types,including some new wrappers for C++ APIs that are not yet exposed by inLLVM's C API, and some new "example" functions in llvmjit_types.cbecause it's no longer possible to start from the function pointer typeand ask for the function type.Back-patch to 12, because it's a little tricker in 11 and we agreed notto put the latest LLVM support into the upcoming final release of 11.[1]https://llvm.org/docs/OpaquePointers.htmlReviewed-by: Dmitry Dolgov <9erthalion6@gmail.com>Reviewed-by: Ronan Dunklau <ronan.dunklau@aiven.io>Reviewed-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/CA%2BhUKGKNX_%3Df%2B1C4r06WETKTq0G4Z_7q4L4Fxn5WWpMycDj9Fw%40mail.gmail.com1 parent3f9b1f2 commit37d5bab
File tree
8 files changed
+481
-264
lines changed- src
- backend/jit/llvm
- include/jit
8 files changed
+481
-264
lines changedLines changed: 31 additions & 28 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
| 67 | + | |
67 | 68 |
| |
68 | 69 |
| |
| 70 | + | |
69 | 71 |
| |
70 | 72 |
| |
71 | 73 |
| |
| |||
76 | 78 |
| |
77 | 79 |
| |
78 | 80 |
| |
| 81 | + | |
79 | 82 |
| |
80 | 83 |
| |
| 84 | + | |
| 85 | + | |
81 | 86 |
| |
82 | 87 |
| |
83 | 88 |
| |
| |||
451 | 456 |
| |
452 | 457 |
| |
453 | 458 |
| |
454 |
| - | |
455 |
| - | |
456 |
| - | |
457 |
| - | |
458 |
| - | |
| 459 | + | |
459 | 460 |
| |
460 | 461 |
| |
461 | 462 |
| |
| |||
467 | 468 |
| |
468 | 469 |
| |
469 | 470 |
| |
470 |
| - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
471 | 477 |
| |
472 |
| - | |
473 |
| - | |
474 |
| - | |
475 |
| - | |
| 478 | + | |
476 | 479 |
| |
477 | 480 |
| |
478 | 481 |
| |
| |||
502 | 505 |
| |
503 | 506 |
| |
504 | 507 |
| |
505 |
| - | |
| 508 | + | |
506 | 509 |
| |
507 | 510 |
| |
508 | 511 |
| |
| |||
598 | 601 |
| |
599 | 602 |
| |
600 | 603 |
| |
601 |
| - | |
| 604 | + | |
602 | 605 |
| |
603 | 606 |
| |
604 | 607 |
| |
| |||
608 | 611 |
| |
609 | 612 |
| |
610 | 613 |
| |
611 |
| - | |
| 614 | + | |
612 | 615 |
| |
613 | 616 |
| |
614 | 617 |
| |
615 | 618 |
| |
616 | 619 |
| |
617 | 620 |
| |
618 | 621 |
| |
619 |
| - | |
| 622 | + | |
620 | 623 |
| |
621 | 624 |
| |
622 | 625 |
| |
| |||
874 | 877 |
| |
875 | 878 |
| |
876 | 879 |
| |
877 |
| - | |
878 |
| - | |
879 |
| - | |
880 |
| - | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
881 | 887 |
| |
882 |
| - | |
| 888 | + | |
883 | 889 |
| |
884 | 890 |
| |
885 | 891 |
| |
| |||
1050 | 1056 |
| |
1051 | 1057 |
| |
1052 | 1058 |
| |
1053 |
| - | |
1054 |
| - | |
1055 |
| - | |
1056 |
| - | |
1057 |
| - | |
1058 |
| - | |
1059 |
| - | |
1060 |
| - | |
1061 |
| - | |
| 1059 | + | |
1062 | 1060 |
| |
1063 | 1061 |
| |
1064 | 1062 |
| |
| |||
1123 | 1121 |
| |
1124 | 1122 |
| |
1125 | 1123 |
| |
| 1124 | + | |
1126 | 1125 |
| |
1127 | 1126 |
| |
1128 | 1127 |
| |
1129 | 1128 |
| |
| 1129 | + | |
| 1130 | + | |
1130 | 1131 |
| |
1131 | 1132 |
| |
| 1133 | + | |
| 1134 | + | |
1132 | 1135 |
| |
1133 | 1136 |
| |
1134 | 1137 |
| |
|
0 commit comments
Comments
(0)