{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,6,18]],"date-time":"2025-06-18T04:20:52Z","timestamp":1750220452965,"version":"3.41.0"},"reference-count":42,"publisher":"Association for Computing Machinery (ACM)","issue":"ICFP","license":[{"start":{"date-parts":[[2020,8,2]],"date-time":"2020-08-02T00:00:00Z","timestamp":1596326400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100000266","name":"EPSRC","doi-asserted-by":"crossref","award":["EP\/P020011\/1"],"award-info":[{"award-number":["EP\/P020011\/1"]}],"id":[{"id":"10.13039\/501100000266","id-type":"DOI","asserted-by":"crossref"}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2020,8,2]]},"abstract":"<jats:p>\n            We present a novel framework,\n            <jats:italic>Duplo<\/jats:italic>\n            , for the low-level post-link optimisation of OCaml programs, achieving a speedup of 7% and a reduction of at least 15% of the code size of widely-used OCaml applications. Unlike existing post-link optimisers, which typically operate on target-specific machine code, our framework operates on a Low-Level Intermediate Representation (LLIR) capable of representing both the OCaml programs and any C dependencies they invoke through the foreign-function interface (FFI). LLIR is analysed, transformed and lowered to machine code by our post-link optimiser, LLIR-OPT. Most importantly, LLIR allows the optimiser to cross the OCaml-C language boundary, mitigating the overhead incurred by the FFI and enabling analyses and transformations in a previously unavailable context. The optimised IR is then lowered to amd64 machine code through the existing target-specific code generator of LLVM, modified to handle garbage collection just as effectively as the native OCaml backend. We equip our optimiser with a suite of SSA-based transformations and points-to analyses capable of capturing the semantics and representing the memory models of both languages, along with a cross-language inliner to embed C methods into OCaml callers. We evaluate the gains of our framework, which can be attributed to both our optimiser and the more sophisticated amd64 backend of LLVM, on a wide-range of widely-used OCaml applications, as well as an existing suite of micro- and macro-benchmarks used to track the performance of the OCaml compiler.\n          <\/jats:p>","DOI":"10.1145\/3408980","type":"journal-article","created":{"date-parts":[[2020,8,3]],"date-time":"2020-08-03T13:48:02Z","timestamp":1596462482000},"page":"1-29","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":0,"title":["Duplo: a framework for OCaml post-link optimisation"],"prefix":"10.1145","volume":"4","author":[{"given":"Nandor","family":"Licker","sequence":"first","affiliation":[{"name":"University of Cambridge, UK"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Timothy M.","family":"Jones","sequence":"additional","affiliation":[{"name":"University of Cambridge, UK"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2020,8,3]]},"reference":[{"key":"e_1_2_2_2_1","doi-asserted-by":"crossref","unstructured":"Andrew W Appel. 1998. SSA is functional programming. ACM SIGPLAN Notices 33 4 ( 1998 ) 17-20.  Andrew W Appel. 1998. SSA is functional programming. ACM SIGPLAN Notices 33 4 ( 1998 ) 17-20.","DOI":"10.1145\/278283.278285"},{"key":"e_1_2_2_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/1356058.1356064"},{"key":"e_1_2_2_4_1","doi-asserted-by":"publisher","DOI":"10.1109\/CGO.2003.1191551"},{"key":"e_1_2_2_5_1","unstructured":"Pierre Chambart. 2016. PR # 608 : Whole program dead code elimination. https:\/\/github.com\/ocaml\/ocaml\/pull\/608.  Pierre Chambart. 2016. PR # 608 : Whole program dead code elimination. https:\/\/github.com\/ocaml\/ocaml\/pull\/608."},{"volume-title":"The musl C standard library. Retrieved July 30 ( 2019 )","year":"2019","author":"Felker Rich","key":"e_1_2_2_6_1"},{"key":"e_1_2_2_7_1","doi-asserted-by":"crossref","unstructured":"Michael Furr and Jefrey S Foster. 2005. Checking type safety of foreign function calls. ACM SIGPLAN Notices 40 6 ( 2005 ) 62-72.  Michael Furr and Jefrey S Foster. 2005. Checking type safety of foreign function calls. ACM SIGPLAN Notices 40 6 ( 2005 ) 62-72.","DOI":"10.1145\/1064978.1065019"},{"key":"e_1_2_2_8_1","doi-asserted-by":"publisher","DOI":"10.1109\/CGO.2005.27"},{"key":"e_1_2_2_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/1250734.1250767"},{"key":"e_1_2_2_10_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-540-74061-2_17"},{"key":"e_1_2_2_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/262004.262005"},{"volume-title":"2012 (E)","year":"2012","author":"ISO","key":"e_1_2_2_12_1"},{"volume-title":"1999","year":"1999","author":"ISO","key":"e_1_2_2_13_1"},{"key":"e_1_2_2_14_1","doi-asserted-by":"publisher","DOI":"10.5555\/3049832.3049849"},{"key":"e_1_2_2_15_1","article-title":"Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine","volume":"2","author":"Peyton Jones Simon L","year":"1992","journal-title":"Journal of functional programming"},{"key":"e_1_2_2_16_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-33125-1_19"},{"key":"e_1_2_2_17_1","volume-title":"The BSD conference","volume":"5","author":"Lattner Chris","year":"2008"},{"key":"e_1_2_2_18_1","unstructured":"Chris Lattner. 2020a. Garbage Collection Safepoints in LLVM. https:\/\/llvm.org\/docs\/Statepoints.html. Accessed: 2020-02-11.  Chris Lattner. 2020a. Garbage Collection Safepoints in LLVM. https:\/\/llvm.org\/docs\/Statepoints.html. Accessed: 2020-02-11."},{"key":"e_1_2_2_19_1","unstructured":"Chris Lattner. 2020b. Writing an LLVM Backend. https:\/\/llvm.org\/docs\/WritingAnLLVMBackend.html. Accessed: 2020-02-19.  Chris Lattner. 2020b. Writing an LLVM Backend. https:\/\/llvm.org\/docs\/WritingAnLLVMBackend.html. Accessed: 2020-02-19."},{"key":"e_1_2_2_21_1","unstructured":"Xavier Leroy. 2009. Google Summer of Code Proposal. https:\/\/inbox.ocaml.org\/caml-list\/ 49C79A54.5020406@inria.fr\/ Accessed: 2020-02-14.  Xavier Leroy. 2009. Google Summer of Code Proposal. https:\/\/inbox.ocaml.org\/caml-list\/ 49C79A54.5020406@inria.fr\/ Accessed: 2020-02-14."},{"key":"e_1_2_2_22_1","unstructured":"Xavier Leroy Damien Doligez Alain Frisch Jacques Garrigue Didier R\u00e9my and J\u00e9r\u00f4me Vouillon. 2014. The OCaml system release 4.02. Institut National de Recherche en Informatique et en Automatique 54 ( 2014 ).  Xavier Leroy Damien Doligez Alain Frisch Jacques Garrigue Didier R\u00e9my and J\u00e9r\u00f4me Vouillon. 2014. The OCaml system release 4.02. Institut National de Recherche en Informatique et en Automatique 54 ( 2014 )."},{"key":"e_1_2_2_23_1","unstructured":"Tim Lindholm Frank Yellin Gilad Bracha and Alex Buckley. 2014. The Java virtual machine specification. Pearson Education.  Tim Lindholm Frank Yellin Gilad Bracha and Alex Buckley. 2014. The Java virtual machine specification. Pearson Education."},{"key":"e_1_2_2_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/2692956.2663188"},{"key":"e_1_2_2_25_1","unstructured":"Mozilla. 2019. Closing the gap: cross-language LTO between Rust and C\/C++. http:\/\/blog.llvm.org\/ 2019 \/09\/closing-gapcross-language-lto-between.html. Accessed: 2019-10-01.  Mozilla. 2019. Closing the gap: cross-language LTO between Rust and C\/C++. http:\/\/blog.llvm.org\/ 2019 \/09\/closing-gapcross-language-lto-between.html. Accessed: 2019-10-01."},{"key":"e_1_2_2_26_1","doi-asserted-by":"crossref","unstructured":"Todd Mytkowicz Amer Diwan Matthias Hauswirth and Peter F Sweeney. 2009. Producing wrong data without doing anything obviously wrong ! ACM Sigplan Notices 44 3 ( 2009 ) 265-276.  Todd Mytkowicz Amer Diwan Matthias Hauswirth and Peter F Sweeney. 2009. Producing wrong data without doing anything obviously wrong ! ACM Sigplan Notices 44 3 ( 2009 ) 265-276.","DOI":"10.1145\/1508284.1508275"},{"key":"e_1_2_2_27_1","doi-asserted-by":"crossref","unstructured":"Esko Nuutila and Eljas Soisalon-Soininen. 1993. On finding the strong components in a directed graph. Helsingin Teknillinen Korkeakoulu. Tietojenk\u00e4sittelytekniikan Laitos.  Esko Nuutila and Eljas Soisalon-Soininen. 1993. On finding the strong components in a directed graph. Helsingin Teknillinen Korkeakoulu. Tietojenk\u00e4sittelytekniikan Laitos.","DOI":"10.1016\/0020-0190(94)90047-7"},{"key":"e_1_2_2_28_1","doi-asserted-by":"publisher","DOI":"10.1109\/CGO.2019.8661201"},{"key":"e_1_2_2_29_1","doi-asserted-by":"publisher","DOI":"10.1145\/1290520.1290524"},{"key":"e_1_2_2_30_1","unstructured":"Fran\u00e7ois Pottier and Yann R\u00e9gis-Gianas. 2016. Menhir reference manual. Inria Aug ( 2016 ).  Fran\u00e7ois Pottier and Yann R\u00e9gis-Gianas. 2016. Menhir reference manual. Inria Aug ( 2016 )."},{"key":"e_1_2_2_31_1","unstructured":"Gabriel Scherer. 2015. Native compiler for oCaml on System Z. https:\/\/inbox.ocaml.org\/caml-list\/ CAPFanBEAN6BA2PhMJ00ybUZVHisu4aLHOwfqmrcH26oBsYW28g@mail.gmail.com\/ Accessed: 2020-02-14.  Gabriel Scherer. 2015. Native compiler for oCaml on System Z. https:\/\/inbox.ocaml.org\/caml-list\/ CAPFanBEAN6BA2PhMJ00ybUZVHisu4aLHOwfqmrcH26oBsYW28g@mail.gmail.com\/ Accessed: 2020-02-14."},{"volume-title":"Proc. 2001 Workshop on Binary Translation (WBT-2001)","year":"2001","author":"Schwarz Benjamin","key":"e_1_2_2_32_1"},{"volume-title":"GHC LLVM LTO Experiments Scratch Notes","author":"Simmons Brandon","key":"e_1_2_2_33_1"},{"key":"e_1_2_2_34_1","doi-asserted-by":"crossref","unstructured":"KC Sivaramakrishnan Stephen Dolan Leo White Sadiq Jafer Tom Kelly Anmol Sahoo Sudha Parimala Atul Dhiman and Anil Madhavapeddy. 2020. Retrofitting Parallelism onto OCaml. ICFP ( 2020 ).  KC Sivaramakrishnan Stephen Dolan Leo White Sadiq Jafer Tom Kelly Anmol Sahoo Sudha Parimala Atul Dhiman and Anil Madhavapeddy. 2020. Retrofitting Parallelism onto OCaml. ICFP ( 2020 ).","DOI":"10.1145\/3408995"},{"key":"e_1_2_2_35_1","doi-asserted-by":"publisher","DOI":"10.1145\/237721.237727"},{"key":"e_1_2_2_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/3168364"},{"volume-title":"Automation & Test in Europe Conference & Exhibition (DATE). IEEE, 1051-1056","year":"2018","author":"Tagliavini Giuseppe","key":"e_1_2_2_37_1"},{"volume-title":"Depth-first search and linear graph algorithms","series-title":"SIAM journal on computing 1, 2 ( 1972 ), 146-160","author":"Tarjan Robert","key":"e_1_2_2_38_1"},{"key":"e_1_2_2_39_1","doi-asserted-by":"publisher","DOI":"10.1145\/1863523.1863538"},{"key":"e_1_2_2_40_1","doi-asserted-by":"crossref","unstructured":"J\u00e9r\u00f4me Vouillon and Vincent Balat. 2014. From bytecode to JavaScript: the Js_of_ocaml compiler. Software: Practice and Experience 44 8 ( 2014 ) 951-972.  J\u00e9r\u00f4me Vouillon and Vincent Balat. 2014. From bytecode to JavaScript: the Js_of_ocaml compiler. Software: Practice and Experience 44 8 ( 2014 ) 951-972.","DOI":"10.1002\/spe.2187"},{"key":"e_1_2_2_41_1","doi-asserted-by":"crossref","unstructured":"Stephen Weeks. 2006. Whole-program compilation in MLton. ML 6 ( 2006 ) 1-1.  Stephen Weeks. 2006. Whole-program compilation in MLton. ML 6 ( 2006 ) 1-1.","DOI":"10.1145\/1159876.1159877"},{"key":"e_1_2_2_42_1","doi-asserted-by":"publisher","DOI":"10.1145\/103135.103136"},{"key":"e_1_2_2_43_1","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-46423-9_1"},{"key":"e_1_2_2_44_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-319-29604-3_13"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3408980","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3408980","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T20:47:58Z","timestamp":1750193278000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3408980"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2020,8,2]]},"references-count":42,"journal-issue":{"issue":"ICFP","published-print":{"date-parts":[[2020,8,2]]}},"alternative-id":["10.1145\/3408980"],"URL":"https:\/\/doi.org\/10.1145\/3408980","relation":{},"ISSN":["2475-1421"],"issn-type":[{"type":"electronic","value":"2475-1421"}],"subject":[],"published":{"date-parts":[[2020,8,2]]},"assertion":[{"value":"2020-08-03","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}