[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-497945-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-497945-en":131},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","testing-static-analyses-for-precision-and-soundness","Testing Static Analyses for Precision and Soundness","","Static analyses compute program properties that hold for all executions, enabling compilers to justify optimizations such as dead code elimination. Each analysis must balance precision, soundness, and performance, since unsoundness causes miscompilations while imprecision prevents optimizations and both defects are hard to diagnose. This work applies formal methods with an SMT solver to design and evaluate algorithms that produce sound and maximally precise results offline. The approach helps identify soundness and precision errors in production compilers like LLVM.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/research-report/","Research & Report",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/testing-static-analyses-for-precision-and-soundness/497945/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/testing-static-analyses-for-precision-and-soundness/497945.png","ImageObject",300,407,{"name":42,"@type":43},"dbqoiu","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-16","2026-10-02",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",12,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"Why do static analyses need both soundness and precision?","Question",{"text":63,"@type":64},"Unsound static analyses can produce incorrect optimization justifications that lead to miscompilations. Imprecise analyses may miss optimization opportunities, reducing performance.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How does the research use formal methods to test compiler analyses?",{"text":68,"@type":64},"It uses an SMT solver to compute sound and maximally precise dataflow facts for concrete code fragments compiled from real applications, then compares results against LLVM.",{"name":70,"@type":61,"acceptedAnswer":71},"What kinds of LLVM static analyses are evaluated?",{"text":72,"@type":64},"The work targets forward and backward dataflow analyses including known bits, demanded bits, integer ranges, and forward analyses for Boolean properties such as non-zero and powers of two.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},497945,1791421318,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,101,106,111,115,120,123,127],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":97,"doc_module":4,"doc_module_name":25,"category_name":98,"show_sort_weight":99,"slug":100},5,"Comic",60,"comic",{"id":102,"doc_module":4,"doc_module_name":25,"category_name":103,"show_sort_weight":104,"slug":105},6,"Technology",50,"technology",{"id":107,"doc_module":4,"doc_module_name":25,"category_name":108,"show_sort_weight":109,"slug":110},7,"Healthcare",40,"healthcare",{"id":112,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":113,"slug":114},8,30,"research-report",{"id":116,"doc_module":4,"doc_module_name":25,"category_name":117,"show_sort_weight":118,"slug":119},9,"Religion & Spirituality",20,"religion-spirituality",{"id":118,"doc_module":4,"doc_module_name":25,"category_name":121,"show_sort_weight":118,"slug":122},"World Cup","world-cup",{"id":124,"doc_module":4,"doc_module_name":25,"category_name":125,"show_sort_weight":124,"slug":126},10,"Lifestyle","lifestyle",{"id":128,"doc_module":4,"doc_module_name":25,"category_name":129,"show_sort_weight":97,"slug":130},19,"General","general",{"code":4,"msg":82,"data":132},{"doc_id":79,"user_id":133,"nickname":42,"user_avatar":134,"doc_module":4,"category_id":112,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":135,"file_id":136,"file_url":137,"file_type":138,"file_size":139,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":140,"language":141,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":142,"faqs":143,"seo_title":144,"seo_description":12,"update_tm":145,"read_time":146,"preview_page_count":33,"preview_urls":147},3985747862462,"https://ap-avatar.wpscdn.com/davatar_3d24733baf745e90a7e4bdd5f77d97b2","Testing Static Analyses for Precision and Soundness  \nJubi Taneja  \nUniversity of Utah USA [jubi@cs.utah.edu](jubi@cs.utah.edu)  \nZhengyang Liu  \nUniversity of Utah USA [liuz@cs.utah.edu](liuz@cs.utah.edu)  \nJohn Regehr  \nUniversity of Utah USA  \n[regehr@cs.utah.edu](regehr@cs.utah.edu)  \nAbstract  \nStatic analyses compute properties of programs that are true in all executions, and compilers use these properties to justify optimizations such as dead code elimination. Each static analysis in a compiler should be as precise as possible while remaining sound and being sufficiently fast. Unsound static analyses typically lead to miscompilations, whereas imprecisions typically lead to missed optimizations. Neither kind of bug is easy to track down.  \nOur research uses formal methods to help compiler developers create better static analyses. Our contribution is the design and evaluation of several algorithms for computing sound and maximally precise static analysis results using an SMT solver. These methods are too slow to use at compile time, but they can be used offline to find soundness and precision errors in a production compiler such as LLVM. We found no new soundness bugs in LLVM, but we can discover previously-fixed soundness errors that we re-introduced into the code base. We identified many imprecisions in LLVM’s static analyses, some of which have been fixed as a result of our work.  \nCCS Concepts · Software and its engineering → Compilers; Formal software verification; Automated static analysis; · Theory of computation → Design and analysis of algorithms.  \nKeywords Dataflow analysis, Soundness, Precision ACM Reference Format:  \nJubi Taneja, Zhengyang Liu, and John Regehr. 2020. Testing Static Analyses for Precision and Soundness. In Proceedings of the 18th ACM/IEEE International Symposium on Code Generation and Optimization (CGO’20), February 22ś26, 2020, San Diego, CA, USA. ACM, New York, NY, USA,13pages. [https://doi.org/10.1145/3368826.3377927](https://doi.org/10.1145/3368826.3377927)  \nPermission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific [permission and/or a fee. Request permissions from permissions@acm.org](permission and/or a fee. Request permissions from permissions@acm.org). CGO’20, February 22ś26, 2020, San Diego, CA, USA  \n© 2020 Copyright held by the owner/author(s) . Publication rights licensed to ACM.  \nACM ISBN 978-1-4503-7047-9/20/02...$15.00  \n[https://doi.org/10.1145/3368826.3377927](https://doi.org/10.1145/3368826.3377927)  \n1 Introduction  \nStatic analysis is one of the basic technologies that enables compilers to generate optimized executables for code in highlevel languages. For example, an integer overflow check can be removed when the operation provably does not overflow, and an array bounds check can be removed when the access is provably in-bounds. In each case, the necessary proof is implied by the results of a static analysis.  \nProduction-quality optimizing compilers have typically had significant engineering effort put into their static analyses. For example, LLVM currently has about 80,000 lines of C++ in its lib/Analysis directory, which contains much, but not all, of its static analysis code. GCC does not have an analogous directory structure that makes it easy to find static analyses, but for example its integer range analysis alone (tree-vrp.c) is 6,929 lines ofC. This code is tricky to get right and, so far, developers are implementing static analyses without any help from formal-methods-based tools.  \nWe have developed algorithms t","cbCaikUaIZHnA0XZ","https://ap.wps.com/l/cbCaikUaIZHnA0XZ","pdf",323704,13,"English","# Introduction\n## Static analysis in compilers\n## Formal methods with SMT solvers\n## Evaluated LLVM dataflow analyses","[{\"question\":\"Why do static analyses need both soundness and precision?\",\"answer\":\"Unsound static analyses can produce incorrect optimization justifications that lead to miscompilations. Imprecise analyses may miss optimization opportunities, reducing performance.\"},{\"question\":\"How does the research use formal methods to test compiler analyses?\",\"answer\":\"It uses an SMT solver to compute sound and maximally precise dataflow facts for concrete code fragments compiled from real applications, then compares results against LLVM.\"},{\"question\":\"What kinds of LLVM static analyses are evaluated?\",\"answer\":\"The work targets forward and backward dataflow analyses including known bits, demanded bits, integer ranges, and forward analyses for Boolean properties such as non-zero and powers of two.\"}]","Testing Static Analyses for Precision and Soundness | PDF",1790972104,33,[148,152,156,160],{"page_no":22,"url":149,"width":150,"height":151},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/b5bd393d0cfd3df084fb442407bfc91f.webp",983,1272,{"page_no":26,"url":153,"width":154,"height":155},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/f6261820b4b1780ad36e44c4d3913d1b.webp",982,1270,{"page_no":30,"url":157,"width":158,"height":159},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/25ea2a50f28910343d4add21b96ff118.webp",981,1269,{"page_no":33,"url":161,"width":162,"height":163},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/9d3bf7e3e1ec2b748e3a9555ab473766.webp",980,1268]