{"id":{"repo_id":"cambridge","oai_identifier":"oai:www.repository.cam.ac.uk:1810/340215"},"canonical_url":"https://search.dev.ndltd.org/etd/cambridge/oai:www.repository.cam.ac.uk:1810/340215","repository":{"repo_id":"cambridge","name":"Cambridge University","base_url":"https://api.repository.cam.ac.uk/server/oai/request"},"display":{"title":"Low-level cross-language post-link optimisation","abstract":"A Foreign Function Interface (FFI) is a powerful tool that allows a method in one language to invoke another method from a distinct language. Unlike calls within the bounds of the same language, invocations through the FFI crossing a language barrier incur a significant overhead, due to both missed optimisation opportunities and the required glue code or trampolines. Since the redundancies are exposed only at link time when the modules of the participating languages are merged together to form the final program, ameliorating the overhead of FFI calls falls within the scope of link-time or post-link optimisers. Presently, such optimisers lack the required specialised transformations to fully exploit the optimisation opportunities exposed by the cross-language context and rely on representations that are either more abstract than some of the participating languages or unreasonably difficult to analyse as they discard all relevant structure. This thesis tackles the problem of cross-language optimisation by introducing the Duplo framework and its associated analyses and transformations. Duplo is built around the Low-Level Intermediate Representation (LLIR), capable of representing both high-level and low-level languages, such as OCaml, Rust and C. The representation is generated through custom compiler backends and assembled into modules carrying whole program information through a specialised toolchain, before optimisations are applied and executable machine code is emitted. Most importantly, LLIR enables inlining across FFI calls, creating opportunities for other improvements. In addition to applying a series of well-established inter-procedural analyses and transformations adapted to the cross-language context, the framework includes novel algorithms designed to operate specifically on global representations, aimed at simplifying the startup path and extracting type information compatible with all source languages for use in further optimisation passes. The Duplo framework and its associated cross-language and inter-procedural optimisations yield substantial benefits in excess of existing tools, improving both the code-size and performance. Results are demonstrated on a diverse range of macro- and micro-benchmarks testing widely used functionality, along with real-world applications.","abstract_html":"A Foreign Function Interface (FFI) is a powerful tool that allows a method in one language to invoke another method from a distinct language. Unlike calls within the bounds of the same language, invocations through the FFI crossing a language barrier incur a significant overhead, due to both missed optimisation opportunities and the required glue code or trampolines. Since the redundancies are exposed only at link time when the modules of the participating languages are merged together to form the final program, ameliorating the overhead of FFI calls falls within the scope of link-time or post-link optimisers. Presently, such optimisers lack the required specialised transformations to fully exploit the optimisation opportunities exposed by the cross-language context and rely on representations that are either more abstract than some of the participating languages or unreasonably difficult to analyse as they discard all relevant structure. This thesis tackles the problem of cross-language optimisation by introducing the Duplo framework and its associated analyses and transformations. Duplo is built around the Low-Level Intermediate Representation (LLIR), capable of representing both high-level and low-level languages, such as OCaml, Rust and C. The representation is generated through custom compiler backends and assembled into modules carrying whole program information through a specialised toolchain, before optimisations are applied and executable machine code is emitted. Most importantly, LLIR enables inlining across FFI calls, creating opportunities for other improvements. In addition to applying a series of well-established inter-procedural analyses and transformations adapted to the cross-language context, the framework includes novel algorithms designed to operate specifically on global representations, aimed at simplifying the startup path and extracting type information compatible with all source languages for use in further optimisation passes. The Duplo framework and its associated cross-language and inter-procedural optimisations yield substantial benefits in excess of existing tools, improving both the code-size and performance. Results are demonstrated on a diverse range of macro- and micro-benchmarks testing widely used functionality, along with real-world applications.","abstract_has_math":false,"creators":["Licker, Nandor"],"institution":"University of Cambridge","degree_name":"Doctor of Philosophy (PhD)","degree_level":"Doctoral","degree_discipline":null,"degree_department":null,"school":null,"contributors":[],"advisors":["Jones, Timothy"],"committee_chairs":[],"committee_members":[],"year":2021,"date_issued":"2021-12-17","date_published":"2021-12-17","updated_at":"2026-07-22T22:24:00Z","subjects":["Compilers","Post-Link Optimisation"],"languages":["eng"],"rights":[],"rights_urls":["https://www.rioxx.net/licenses/all-rights-reserved/"],"identifier_entries":[]},"links":{"outbound_url":"https://doi.org/10.17863/CAM.87641","outbound_label":"DOI","outbound_source":"dc:identifier.doi"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor.advisor","label":"Advisor","values":["Jones, Timothy"]},{"key":"dc:contributor.sponsor","label":"Sponsor","values":["Cambridge Trust Vice Chancellor's scholarship"]},{"key":"dc:creator","label":"Author","values":["Licker, Nandor"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.issued","label":"Date","values":["2021-12-17"]},{"key":"dc:publisher.institution","label":"Dc Publisher Institution","values":["University of Cambridge"]},{"key":"dc:relation.isreferencedby.uri","label":"Dc Relation Isreferencedby URI","values":["https://www.repository.cam.ac.uk/handle/1810/340215"]},{"key":"dc:type","label":"Dc Type","values":["Thesis"]},{"key":"dc:type.qualificationlevel","label":"Dc Type Qualificationlevel","values":["Doctoral"]},{"key":"dc:type.qualificationname","label":"Dc Type Qualificationname","values":["Doctor of Philosophy (PhD)"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["Compilers","Post-Link Optimisation"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language","label":"Dc Language","values":["eng"]},{"key":"dc:rights","label":"Dc Rights","values":["https://www.rioxx.net/licenses/all-rights-reserved/"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.doi","label":"DOI","values":["10.17863/CAM.87641"]},{"key":"dc:identifier.uri","label":"Identifier URI","values":["https://apollo8-f-pro.lib.cam.ac.uk/bitstreams/044df4bc-bdf0-4472-ad51-c5d6c2f541dc/download"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["A Foreign Function Interface (FFI) is a powerful tool that allows a method in one language to invoke another method from a distinct language. Unlike calls within the bounds of the same language, invocations through the FFI crossing a language barrier incur a significant overhead, due to both missed optimisation opportunities and the required glue code or trampolines. Since the redundancies are exposed only at link time when the modules of the participating languages are merged together to form the final program, ameliorating the overhead of FFI calls falls within the scope of link-time or post-link optimisers. Presently, such optimisers lack the required specialised transformations to fully exploit the optimisation opportunities exposed by the cross-language context and rely on representations that are either more abstract than some of the participating languages or unreasonably difficult to analyse as they discard all relevant structure. This thesis tackles the problem of cross-language optimisation by introducing the Duplo framework and its associated analyses and transformations. Duplo is built around the Low-Level Intermediate Representation (LLIR), capable of representing both high-level and low-level languages, such as OCaml, Rust and C. The representation is generated through custom compiler backends and assembled into modules carrying whole program information through a specialised toolchain, before optimisations are applied and executable machine code is emitted. Most importantly, LLIR enables inlining across FFI calls, creating opportunities for other improvements. In addition to applying a series of well-established inter-procedural analyses and transformations adapted to the cross-language context, the framework includes novel algorithms designed to operate specifically on global representations, aimed at simplifying the startup path and extracting type information compatible with all source languages for use in further optimisation passes. The Duplo framework and its associated cross-language and inter-procedural optimisations yield substantial benefits in excess of existing tools, improving both the code-size and performance. Results are demonstrated on a diverse range of macro- and micro-benchmarks testing widely used functionality, along with real-world applications."]},{"key":"dc:format.checksum.md5","label":"Dc Format Checksum Md5","values":["847d5620886f4a45b1bc3b25968603d7"]},{"key":"dc:title","label":"Title","values":["Low-level cross-language post-link optimisation"]}]}],"canonical_facts":{"dc:contributor.advisor":["Jones, Timothy"],"dc:contributor.sponsor":["Cambridge Trust Vice Chancellor's scholarship"],"dc:creator":["Licker, Nandor"],"dc:date.issued":["2021-12-17"],"dc:description.abstract":["A Foreign Function Interface (FFI) is a powerful tool that allows a method in one language to invoke another method from a distinct language. Unlike calls within the bounds of the same language, invocations through the FFI crossing a language barrier incur a significant overhead, due to both missed optimisation opportunities and the required glue code or trampolines. Since the redundancies are exposed only at link time when the modules of the participating languages are merged together to form the final program, ameliorating the overhead of FFI calls falls within the scope of link-time or post-link optimisers. Presently, such optimisers lack the required specialised transformations to fully exploit the optimisation opportunities exposed by the cross-language context and rely on representations that are either more abstract than some of the participating languages or unreasonably difficult to analyse as they discard all relevant structure. This thesis tackles the problem of cross-language optimisation by introducing the Duplo framework and its associated analyses and transformations. Duplo is built around the Low-Level Intermediate Representation (LLIR), capable of representing both high-level and low-level languages, such as OCaml, Rust and C. The representation is generated through custom compiler backends and assembled into modules carrying whole program information through a specialised toolchain, before optimisations are applied and executable machine code is emitted. Most importantly, LLIR enables inlining across FFI calls, creating opportunities for other improvements. In addition to applying a series of well-established inter-procedural analyses and transformations adapted to the cross-language context, the framework includes novel algorithms designed to operate specifically on global representations, aimed at simplifying the startup path and extracting type information compatible with all source languages for use in further optimisation passes. The Duplo framework and its associated cross-language and inter-procedural optimisations yield substantial benefits in excess of existing tools, improving both the code-size and performance. Results are demonstrated on a diverse range of macro- and micro-benchmarks testing widely used functionality, along with real-world applications."],"dc:format.checksum.md5":["847d5620886f4a45b1bc3b25968603d7"],"dc:identifier.doi":["10.17863/CAM.87641"],"dc:identifier.uri":["https://apollo8-f-pro.lib.cam.ac.uk/bitstreams/044df4bc-bdf0-4472-ad51-c5d6c2f541dc/download"],"dc:language":["eng"],"dc:publisher.institution":["University of Cambridge"],"dc:relation.isreferencedby.uri":["https://www.repository.cam.ac.uk/handle/1810/340215"],"dc:rights":["https://www.rioxx.net/licenses/all-rights-reserved/"],"dc:subject":["Compilers","Post-Link Optimisation"],"dc:title":["Low-level cross-language post-link optimisation"],"dc:type":["Thesis"],"dc:type.qualificationlevel":["Doctoral"],"dc:type.qualificationname":["Doctor of Philosophy (PhD)"]},"updated_at":"2026-07-22T22:24:00Z"}