{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,9,22]],"date-time":"2026-09-22T11:07:35Z","timestamp":1790075255603,"version":"4.0.1"},"reference-count":62,"publisher":"Association for Computing Machinery (ACM)","issue":"PLDI","license":[{"start":{"date-parts":[[2026,6,8]],"date-time":"2026-06-08T00:00:00Z","timestamp":1780876800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/legalcode"}],"funder":[{"name":"FCT","award":["UID\/50021\/2025"],"award-info":[{"award-number":["UID\/50021\/2025"]}]},{"name":"FCT","award":["UID\/PRR\/50021\/2025"],"award-info":[{"award-number":["UID\/PRR\/50021\/2025"]}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2026,6,8]]},"abstract":"<jats:p>LLVM\u2019s intermediate representation (IR) has two deferred undefined behavior (UB) values: undef and poison. The existence of these two values has been a persistent source of bugs. Reasoning about the correctness of analyses and optimizations for the regular cases is already tricky; ensuring that these are sound for all UB cases is highly non-trivial.<\/jats:p>\n                  <jats:p>\n                    Undef values, in particular, are one of the most misunderstood concepts of LLVM IR. On paper, the definition is simple: they represent an arbitrary value of the underlying type, and can yield a different value each time they are observed. However, this property makes even simple algebraic rewrites, such as replacing\n                    <jats:inline-formula>\n                      <mml:math xmlns:mml=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"inline\">\n                        <mml:mrow>\n                          <mml:mn>2<\/mml:mn>\n                          <mml:mo>\u00d7<\/mml:mo>\n                          <mml:mi mathvariant=\"italic\">y<\/mml:mi>\n                        <\/mml:mrow>\n                      <\/mml:math>\n                    <\/jats:inline-formula>\n                    with\n                    <jats:inline-formula>\n                      <mml:math xmlns:mml=\"http:\/\/www.w3.org\/1998\/Math\/MathML\" display=\"inline\">\n                        <mml:mrow>\n                          <mml:mi mathvariant=\"italic\">y<\/mml:mi>\n                          <mml:mo>+<\/mml:mo>\n                          <mml:mi mathvariant=\"italic\">y<\/mml:mi>\n                        <\/mml:mrow>\n                      <\/mml:math>\n                    <\/jats:inline-formula>\n                    , unsound in LLVM.\n                  <\/jats:p>\n                  <jats:p>Because reasoning about undef is hard, and the benefits of having it are limited, we have set a roadmap to eliminate it altogether from LLVM IR. The last remaining use of undef is the value of uninitialized memory, which has implications on the lowering of bitfields, as well as raw data copies and comparisons.<\/jats:p>\n                  <jats:p>In this paper, we propose an extension to LLVM IR that includes a raw memory value type and a freezing load. We show that these two constructs are sufficient to replace the remaining uses of undef in LLVM. Our implementation shows that these changes have minimal impact on both run-time and compile-time performance. By removing the final hurdle to eliminating undef from LLVM IR, this work paves the way for a simpler semantic model and easier reasoning about the soundness of IR analyses and optimizations.<\/jats:p>","DOI":"10.1145\/3808250","type":"journal-article","created":{"date-parts":[[2026,6,8]],"date-time":"2026-06-08T18:04:09Z","timestamp":1780941849000},"page":"76-99","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":0,"title":["Towards Removing Undef Values from LLVM IR"],"prefix":"10.1145","volume":"10","author":[{"ORCID":"https:\/\/orcid.org\/0009-0003-7723-0904","authenticated-orcid":false,"given":"Pedro","family":"Lobo","sequence":"first","affiliation":[{"name":"INESC-ID, Lisbon, Portugal"},{"name":"Instituto Superior T\u00e9cnico - University of Lisbon, Lisbon, Portugal"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0003-9641-4506","authenticated-orcid":false,"given":"John","family":"McIver","sequence":"additional","affiliation":[{"name":"Virginia Tech, Blacksburg, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-7758-9496","authenticated-orcid":false,"given":"George","family":"Mitenkov","sequence":"additional","affiliation":[{"name":"Aptos Labs, London, United Kingdom"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-8152-9330","authenticated-orcid":false,"given":"Juneyoung","family":"Lee","sequence":"additional","affiliation":[{"name":"AWS, Austin, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-6384-062X","authenticated-orcid":false,"given":"Kirshanthan","family":"Sundararajah","sequence":"additional","affiliation":[{"name":"Virginia Tech, Blacksburg, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-3160-1672","authenticated-orcid":false,"given":"Nuno P.","family":"Lopes","sequence":"additional","affiliation":[{"name":"INESC-ID, Lisbon, Portugal"},{"name":"Instituto Superior T\u00e9cnico - University of Lisbon, Lisbon, Portugal"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2026,6,8]]},"reference":[{"key":"e_1_3_1_2_2","volume-title":"The Static Single Information Form","author":"Ananian C. Scott","year":"1999","unstructured":"C. Scott Ananian. 1999. The Static Single Information Form. Master\u2019s thesis. MIT. https:\/\/dspace.mit.edu\/handle\/1721.1\/149908"},{"key":"e_1_3_1_3_2","doi-asserted-by":"publisher","DOI":"10.1145\/3674652"},{"key":"e_1_3_1_4_2","doi-asserted-by":"publisher","DOI":"10.1145\/3763147"},{"key":"e_1_3_1_5_2","doi-asserted-by":"publisher","unstructured":"Fr\u00e9d\u00e9ric Besson Sandrine Blazy and Pierre Wilke. 2015. A Concrete Memory Model for CompCert. In ITP. doi:10.1007\/978-3-319-22102-1_5","DOI":"10.1007\/978-3-319-22102-1_5"},{"key":"e_1_3_1_6_2","doi-asserted-by":"publisher","unstructured":"Fr\u00e9d\u00e9ric Besson Sandrine Blazy and Pierre Wilke. 2017. CompCertS: A Memory-Aware Verified C Compiler Using Pointer as Integer Semantics. In ITP. doi:10.1007\/978-3-319-66107-0_6","DOI":"10.1007\/978-3-319-66107-0_6"},{"key":"e_1_3_1_7_2","doi-asserted-by":"publisher","DOI":"10.1007\/s10817-017-9439-z"},{"key":"e_1_3_1_8_2","doi-asserted-by":"publisher","DOI":"10.1145\/2180887.2180898"},{"key":"e_1_3_1_9_2","doi-asserted-by":"publisher","unstructured":"Matthias Braun Sebastian Buchwald Sebastian Hack Roland Lei\u00dfa Christoph Mallon and Andreas Zwinkau. 2013. Simple and efficient construction of static single assignment form. In CC. doi:10.1007\/978-3-642-37051-9_6","DOI":"10.1007\/978-3-642-37051-9_6"},{"key":"e_1_3_1_10_2","doi-asserted-by":"publisher","unstructured":"Soham Chakraborty and Viktor Vafeiadis. 2017. Formalizing the concurrency semantics of an LLVM fragment. In CGO. doi:10.1109\/CGO.2017.7863732","DOI":"10.1109\/CGO.2017.7863732"},{"key":"e_1_3_1_11_2","doi-asserted-by":"publisher","unstructured":"Fred Chow Sun Chan Shin-Ming Liu Raymond Lo and Mark Streich. 1996. Effective representation of aliases and indirect memory operations in SSA form. In CC. doi:10.1007\/3-540-61053-7_66","DOI":"10.1007\/3-540-61053-7_66"},{"key":"e_1_3_1_12_2","doi-asserted-by":"publisher","DOI":"10.1145\/115372.115320"},{"key":"e_1_3_1_13_2","doi-asserted-by":"publisher","unstructured":"Manjeet Dahiya and Sorav Bansal. 2017. Modeling Undefined Behaviour Semantics for Checking Equivalence Across Compiler Optimizations. In HVC. doi:10.1007\/978-3-319-70389-3_2","DOI":"10.1007\/978-3-319-70389-3_2"},{"key":"e_1_3_1_14_2","doi-asserted-by":"publisher","unstructured":"Brooks Davis Robert N. M. Watson Alexander Richardson Peter G. Neumann Simon W. Moore John Baldwin David Chisnall Jessica Clarke Nathaniel Wesley Filardo Khilan Gudka Alexandre Joannou Ben Laurie A. Theodore Markettos J. Edward Maste Alfredo Mazzinghi Edward Tomasz Napierala Robert M. Norton Michael Roe Peter Sewell Stacey Son and Jonathan Woodruff. 2019. CheriABI: Enforcing Valid Pointer Provenance and Minimizing Pointer Privilege in the POSIX C Run-time Environment. In ASPLOS. doi:10.1145\/3297858.3304042","DOI":"10.1145\/3297858.3304042"},{"key":"e_1_3_1_15_2","doi-asserted-by":"publisher","DOI":"10.1145\/2743019"},{"key":"e_1_3_1_16_2","doi-asserted-by":"publisher","unstructured":"Amer Diwan Kathryn S. McKinley and J. Eliot B. Moss. 1998. Type-based alias analysis. In PLDI. doi:10.1145\/277650.277670","DOI":"10.1145\/277650.277670"},{"key":"e_1_3_1_17_2","unstructured":"Jeroen Dobbelaere. 2019. Full \u2018restrict\u2019 support in LLVM. https:\/\/discourse.llvm.org\/t\/full-restrict-support-in-llvm\/53267"},{"key":"e_1_3_1_18_2","doi-asserted-by":"publisher","unstructured":"Johannes Doerfert Brian Homerding and Hal Finkel. 2019. Performance exploration through optimistic static program annotations. In ISC High Performance 2019. doi:10.1007\/978-3-030-20656-7_13","DOI":"10.1007\/978-3-030-20656-7_13"},{"key":"e_1_3_1_19_2","doi-asserted-by":"publisher","unstructured":"Dan Frumin L\u00e9on Gondelman and Robbert Krebbers. 2019. Semi-automated Reasoning About Non-determinism in C Expressions. In ESOP. doi:10.1007\/978-3-030-17184-1_3","DOI":"10.1007\/978-3-030-17184-1_3"},{"key":"e_1_3_1_20_2","doi-asserted-by":"publisher","unstructured":"Chris Hathhorn Chucky Ellison and Grigore Ro\u015fu. 2015. Defining the undefinedness of C. In PLDI. doi:10.1145\/2737924.2737979","DOI":"10.1145\/2737924.2737979"},{"key":"e_1_3_1_21_2","doi-asserted-by":"publisher","unstructured":"Eduard Kamburjan and Nathan Wasser. 2022. The Right Kind of Non-Determinism: Using Concurrency to Verify C Programs with Underspecified Semantics. In ICE. doi:10.4204\/EPTCS.365.1","DOI":"10.4204\/EPTCS.365.1"},{"key":"e_1_3_1_22_2","doi-asserted-by":"publisher","unstructured":"Jeehoon Kang Chung-Kil Hur William Mansky Dmitri Garbuzov Steve Zdancewic and Viktor Vafeiadis. 2015. A formal C memory model supporting integer-pointer casts. In PLDI. doi:10.1145\/2737924.2738005","DOI":"10.1145\/2737924.2738005"},{"key":"e_1_3_1_23_2","doi-asserted-by":"publisher","unstructured":"Jeehoon Kang Yoonseung Kim Youngju Song Juneyoung Lee Sanghoon Park Mark Dongyeon Shin Yonghyun Kim Sungkeun Cho Joonwon Choi Chung-Kil Hur and Kwangkeun Yi. 2018. Crellvm: verified credible compilation for LLVM. In PLDI. doi:10.1145\/3192366.3192377","DOI":"10.1145\/3192366.3192377"},{"key":"e_1_3_1_24_2","doi-asserted-by":"publisher","unstructured":"Andreas D. Kellas Alan Cao Peter Goodman and Junfeng Yang. 2023. Divergent Representations: When Compiler Optimizations Enable Exploitation. In SPW. doi:10.1109\/SPW59333.2023.00035","DOI":"10.1109\/SPW59333.2023.00035"},{"key":"e_1_3_1_25_2","doi-asserted-by":"publisher","DOI":"10.1145\/3704881"},{"key":"e_1_3_1_26_2","doi-asserted-by":"publisher","unstructured":"Robbert Krebbers. 2013. Aliasing Restrictions of C11 Formalized in Coq. In CPP. doi:10.1007\/978-3-319-03545-1_4","DOI":"10.1007\/978-3-319-03545-1_4"},{"key":"e_1_3_1_27_2","doi-asserted-by":"publisher","DOI":"10.1007\/s10817-016-9369-1"},{"key":"e_1_3_1_28_2","doi-asserted-by":"publisher","unstructured":"Robbert Krebbers and Freek Wiedijk. 2015. A Typed C11 Semantics for Interactive Theorem Proving. In CPP. doi:10.1145\/2676724.2693571","DOI":"10.1145\/2676724.2693571"},{"key":"e_1_3_1_29_2","doi-asserted-by":"publisher","DOI":"10.1145\/3729275"},{"key":"e_1_3_1_30_2","unstructured":"Thomas K\u00f6ppe. 2024. P2795R5: Erroneous behaviour for uninitialized reads. https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2024\/p2795r5.html"},{"key":"e_1_3_1_31_2","doi-asserted-by":"publisher","DOI":"10.1145\/3276495"},{"key":"e_1_3_1_32_2","doi-asserted-by":"publisher","unstructured":"Juneyoung Lee Dongjoo Kim Chung-Kil Hur and Nuno P. Lopes. 2021. An SMT Encoding of LLVM\u2019s Memory Model for Bounded Translation Validation. In CAV. doi:10.1007\/978-3-030-81688-9_35","DOI":"10.1007\/978-3-030-81688-9_35"},{"key":"e_1_3_1_33_2","doi-asserted-by":"publisher","unstructured":"Juneyoung Lee Yoonseung Kim Youngju Song Chung-Kil Hur Sanjoy Das David Majnemer John Regehr and Nuno P. Lopes. 2017. Taming undefined behavior in LLVM. In PLDI. doi:10.1145\/3062341.3062343","DOI":"10.1145\/3062341.3062343"},{"key":"e_1_3_1_34_2","doi-asserted-by":"publisher","DOI":"10.1145\/3498681"},{"key":"e_1_3_1_35_2","doi-asserted-by":"publisher","DOI":"10.1145\/1538788.1538814"},{"key":"e_1_3_1_36_2","doi-asserted-by":"publisher","DOI":"10.1007\/s10817-008-9099-0"},{"key":"e_1_3_1_37_2","doi-asserted-by":"publisher","unstructured":"Liyi Li and Elsa L. Gunter. 2020. K-LLVM: A Relatively Complete Semantics of LLVM IR. In ECOOP. doi:10.4230\/LIPIcs.ECOOP.2020.7","DOI":"10.4230\/LIPIcs.ECOOP.2020.7"},{"key":"e_1_3_1_38_2","doi-asserted-by":"publisher","unstructured":"Nuno P. Lopes Juneyoung Lee Chung-Kil Hur Zhengyang Liu and John Regehr. 2021. Alive2: bounded translation validation for LLVM. In PLDI. doi:10.1145\/3453483.3454030","DOI":"10.1145\/3453483.3454030"},{"key":"e_1_3_1_39_2","doi-asserted-by":"publisher","unstructured":"Nuno P. Lopes David Menendez Santosh Nagarakatte and John Regehr. 2015. Provably Correct Peephole Pptimizations with Alive. In PLDI. doi:10.1145\/2737924.2737965","DOI":"10.1145\/2737924.2737965"},{"key":"e_1_3_1_40_2","doi-asserted-by":"publisher","DOI":"10.1145\/3290380"},{"key":"e_1_3_1_41_2","doi-asserted-by":"publisher","unstructured":"Kayvan Memarian Justus Matthiesen James Lingard Kyndylan Nienhuis David Chisnall Robert N. M. Watson and Peter Sewell. 2016. Into the depths of C: elaborating the de facto standards. In PLDI. doi:10.1145\/2908080.2908081","DOI":"10.1145\/2908080.2908081"},{"key":"e_1_3_1_42_2","doi-asserted-by":"publisher","unstructured":"Eric Mullen Daryl Zuniga Zachary Tatlock and Dan Grossman. 2016. Verified peephole optimizations for CompCert. In PLDI. doi:10.1145\/2908080.2908109","DOI":"10.1145\/2908080.2908109"},{"key":"e_1_3_1_43_2","unstructured":"Diego Novillo. 2007. Memory SSA - A Unified Approach for Sparsely Representing Memory Operations. In GCC Developers\u2019 Summit. https:\/\/www.airs.com\/dnovillo\/Papers\/mem-ssa.pdf"},{"key":"e_1_3_1_44_2","doi-asserted-by":"publisher","unstructured":"Ankush Phulia Vaibhav Bhagee and Sorav Bansal. 2020. OOElala: order-of-evaluation based alias analysis for compiler optimization. In PLDI. doi:10.1145\/3385412.3385962","DOI":"10.1145\/3385412.3385962"},{"key":"e_1_3_1_45_2","doi-asserted-by":"publisher","DOI":"10.1145\/3729260"},{"key":"e_1_3_1_46_2","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-030-80515-9"},{"key":"e_1_3_1_47_2","doi-asserted-by":"publisher","unstructured":"Zefan Shen. 2022. The Impact of Undefined Behavior on Compiler Optimization. In ESSE. doi:10.1145\/3501774.3501781","DOI":"10.1145\/3501774.3501781"},{"key":"e_1_3_1_48_2","doi-asserted-by":"publisher","unstructured":"Chengnian Sun Vu Le Qirun Zhang and Zhendong Su. 2016. Toward understanding compiler bugs in GCC and LLVM. In ISSTA. doi:10.1145\/2931037.2931074","DOI":"10.1145\/2931037.2931074"},{"key":"e_1_3_1_49_2","doi-asserted-by":"publisher","unstructured":"Jubi Taneja Zhengyang Liu and John Regehr. 2020. Testing static analyses for precision and soundness. In CGO. doi:10.1145\/3368826.3377927","DOI":"10.1145\/3368826.3377927"},{"key":"e_1_3_1_50_2","doi-asserted-by":"publisher","DOI":"10.1145\/3656404"},{"key":"e_1_3_1_51_2","doi-asserted-by":"publisher","unstructured":"Andrew Tolmach Chris Chhak and Sean Anderson. 2024. Defining and Preserving More C Behaviors: Verified Compilation Using a Concrete Memory Model. In ITP. doi:10.4230\/LIPIcs.ITP.2024.36","DOI":"10.4230\/LIPIcs.ITP.2024.36"},{"key":"e_1_3_1_52_2","doi-asserted-by":"publisher","unstructured":"Xi Wang Haogang Chen Alvin Cheung Zhihao Jia Nickolai Zeldovich and M. Frans Kaashoek. 2012. Undefined behavior: what happened to my code?. In APSYS. doi:10.1145\/2349896.2349905","DOI":"10.1145\/2349896.2349905"},{"key":"e_1_3_1_53_2","doi-asserted-by":"publisher","unstructured":"Xi Wang Nickolai Zeldovich M. Frans Kaashoek and Armando Solar-Lezama. 2013. Towards optimization-safe systems: analyzing the impact of undefined behavior. In SOSP. doi:10.1145\/2517349.2522728","DOI":"10.1145\/2517349.2522728"},{"key":"e_1_3_1_54_2","unstructured":"Jianhao Xu Kangjie Lu Zhengjie Du Zhu Ding Linke Li Qiushi Wu Mathias Payer and Bing Mao. 2023. Silent Bugs Matter: A Study of Compiler-Introduced Security Bugs. In USENIX Security. https:\/\/www.usenix.org\/system\/files\/usenixsecurity23-xu-jianhao.pdf"},{"key":"e_1_3_1_55_2","unstructured":"Shafik Yaghmour. 2019. C++ Proposal P1705R1: Enumerating Core Undefined Behavior. https:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2019\/p1705r1.html"},{"key":"e_1_3_1_56_2","doi-asserted-by":"publisher","unstructured":"Xuejun Yang Yang Chen Eric Eide and John Regehr. 2011. Finding and understanding bugs in C compilers. In PLDI. doi:10.1145\/1993498.1993532","DOI":"10.1145\/1993498.1993532"},{"key":"e_1_3_1_57_2","doi-asserted-by":"publisher","DOI":"10.1145\/3473572"},{"key":"e_1_3_1_58_2","doi-asserted-by":"publisher","unstructured":"Vadim Zaliva Kayvan Memarian Brian Campbell Ricardo Almeida Nathaniel Filardo Ian Stark and Peter Sewell. 2025. A CHERI C Memory Model for Verified Temporal Safety. In CPP. doi:10.1145\/3703595.3705878","DOI":"10.1145\/3703595.3705878"},{"key":"e_1_3_1_59_2","doi-asserted-by":"publisher","unstructured":"Jianzhou Zhao Santosh Nagarakatte Milo M.K. Martin and Steve Zdancewic. 2012. Formalizing the LLVM intermediate representation for verified program transformations. In POPL. doi:10.1145\/2103656.2103709","DOI":"10.1145\/2103656.2103709"},{"key":"e_1_3_1_60_2","unstructured":"Peter Zhong Shu-Hung You Simone Campanoni Robert Bruce Findler Matthew Flatt and Christos Dimoulas. 2024. A Calculus for Unreachable Code. arXiv:2407.04917"},{"key":"e_1_3_1_61_2","doi-asserted-by":"publisher","DOI":"10.1145\/3728974"},{"key":"e_1_3_1_62_2","doi-asserted-by":"publisher","DOI":"10.1016\/j.jss.2020.110884"},{"key":"e_1_3_1_63_2","unstructured":"Zoxc. 2022. A memory model for LLVM IR supporting limited type punning. https:\/\/discourse.llvm.org\/t\/a-memory-model-for-llvm-ir-supporting-limited-type-punning\/61948"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3808250","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,9,22]],"date-time":"2026-09-22T10:42:10Z","timestamp":1790073730000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3808250"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,6,8]]},"references-count":62,"journal-issue":{"issue":"PLDI","published-print":{"date-parts":[[2026,6,8]]}},"alternative-id":["10.1145\/3808250"],"URL":"https:\/\/doi.org\/10.1145\/3808250","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,6,8]]},"assertion":[{"value":"2025-11-13","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2026-04-03","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2026-06-08","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}