Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1109/CGO53902.2022.9741273acmconferencesArticle/Chapter ViewAbstractPublication PagescgoConference Proceedingsconference-collections
research-article

Automatic generation of debug headers through BlackBox equivalence checking

Published: 09 May 2022 Publication History

Abstract

Modern compiler optimization pipelines are large and complex, and it is rather cumbersome and error-prone for compiler developers to preserve debugging information across optimization passes. An optimization can add, remove, or reorder code and variables, which makes it difficult to associate the generated code statements and values with the source code statements and values. Moreover recent proposals for automatic generation of optimizations (e.g., through search algorithms) have not previously considered the preservation of debugging information.
We demonstrate the application of a blackbox equivalence checker to automatically populate the debugging information in the debug headers of the optimized executables compiled from C programs. A blackbox equivalence checker can automatically compute equivalence proofs between the original source code and the optimized executable code without the knowledge of the exact transformations performed by the compiler/optimizer. We present an algorithm that uses these formal equivalence proofs to improve the executable's debugging headers. We evaluate this approach on benchmarks derived from the Testsuite of Vectorizing Compilers (TSVC) compiled through three different compilers: GCC, Clang/LLVM, and ICC. We demonstrate significant improvements in the debuggability of the optimized executable code in these experiments. The benefits of these improvements can be transparently realized through any standard debugger, such as GDB, to debug the updated executable.

References

[1]
H. Massalin, "Superoptimizer: A look at the smallest program," in ASPLOS '87: Proceedings of the Second International Conference on Architectural Support for Programming Languages and Operating Systems, 1987, pp. 122--126.
[2]
R. Joshi, G. Nelson, and K. H. Randall, "Denali: A goal-directed superoptimizer," in PLDI '02: Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, Berlin, Germany, June 2002, pp. 304--314.
[3]
S. Bansal and A. Aiken, "Automatic generation of peephole superoptimizers," in Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems, ser. ASPLOS XII. New York, NY, USA: ACM, 2006, pp. 394--403. [Online].
[4]
R. Tate, M. Stepp, Z. Tatlock, and S. Lerner, "Equality saturation: a new approach to optimization," in POPL '09: Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages. New York, NY, USA: ACM, 2009, pp. 264--276. [Online]. Available: http://www.cs.cornell.edu/~ross/publications/eqsat/
[5]
E. Schkufza, R. Sharma, and A. Aiken, "Stochastic superoptimization," in Proceedings of the Eighteenth International Conference on Architectural Support for Programming Languages and Operating Systems, ser. ASPLOS '13. New York, NY, USA: ACM, 2013, pp. 305--316. [Online].
[6]
B. Churchill, R. Sharma, J. Bastien, and A. Aiken, "Sound loop superoptimization for Google native client," in Proceedings of the Twenty-Second International Conference on Architectural Support for Programming Languages and Operating Systems, ser. ASPLOS '17. ACM, 2017, pp. 313--326.
[7]
R. Sasnauskas, Y. Chen, P. Collingbourne, J. Ketema, J. Taneja, and J. Regehr, "Souper: A synthesizing superoptimizer," CoRR, vol. abs/1711.04422, 2017. [Online]. Available: http://arxiv.org/abs/1711.04422
[8]
S. Maleki, Y. Gao, M. J. Garzarán, T. Wong, and D. A. Padua, "An evaluation of vectorizing compilers," in Proceedings of the 2011 International Conference on Parallel Architectures and Compilation Techniques, ser. PACT '11. Washington, DC, USA: IEEE Computer Society, 2011, pp. 372--382. [Online].
[9]
M. Dahiya and S. Bansal, "Black-box equivalence checking across compiler optimizations," in Programming Languages and Systems - 15th Asian Symposium, APLAS 2017, Suzhou, China, November 27-29, 2017, Proceedings, 2017, pp. 127--147. [Online].
[10]
B. Churchill, "Blackbox equivalence checking of program optimizations," Ph.D. dissertation, Stanford University, 2019.
[11]
S. Gupta, A. Rose, and S. Bansal, "Counterexample-guided correlation algorithm for translation validation," Proc. ACM Program. Lang., vol. 4, no. OOPSLA, Nov. 2020. [Online].
[12]
B. Churchill, O. Padon, R. Sharma, and A. Aiken, "Semantic program alignment for equivalence checking," in Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation, ser. PLDI 2019. New York, NY, USA: ACM, 2019, pp. 1027--1040. [Online].
[13]
M. Müller-Olm and H. Seidl, "Analysis of modular arithmetic," in Programming Languages and Systems, M. Sagiv, Ed. Berlin, Heidelberg: Springer Berlin Heidelberg, 2005, pp. 46--60.
[14]
H. Anton and C. Rorres, Elementary Linear Algebra: Applications Version. Wiley.
[15]
U. Hölzle, C. Chambers, and D. Ungar, "Debugging optimized code with dynamic deoptimization," in Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation, ser. PLDI '92. New York, NY, USA: Association for Computing Machinery, 1992, p. 32--43. [Online].
[16]
C. M. Tice, "Non-transparent debugging of optimized code," 2 2000. [Online].
[17]
L. Berger and R. Wismüller, "Source-level debugging of optimized programs using data flow analysis," 1992.
[18]
C. Jaramillo, R. Gupta, and M. L. Soffa, "Fulldoc: A full reporting debugger for optimized code," in Static Analysis, J. Palsberg, Ed. Berlin, Heidelberg: Springer Berlin Heidelberg, 2000, pp. 240--259.
[19]
P. T. Zellweger, "An interactive high-level debugger for control-flow optimized programs," in Proceedings of the Symposium on High-Level Debugging, ser. SIGSOFT '83. New York, NY, USA: Association for Computing Machinery, 1983, p. 159--172. [Online].
[20]
G. Brooks, G. J. Hansen, and S. Simmons, "A new approach to debugging optimized code," in Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation, ser. PLDI '92. New York, NY, USA: Association for Computing Machinery, 1992, p. 1--11. [Online].
[21]
A.-R. Adl-Tabatabai and T. Gross, "Source-level debugging of scalar optimized code," in Proceedings of the ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation, ser. PLDI '96. New York, NY, USA: Association for Computing Machinery, 1996, p. 33--43. [Online].
[22]
R. Wismüller, "Debugging of globally optimized programs using data flow analysis," in Proceedings of the ACM SIGPLAN 1994 Conference on Programming Language Design and Implementation, ser. PLDI '94. New York, NY, USA: Association for Computing Machinery, 1994, p. 278--289. [Online].
[23]
M. Copperman, "Debugging optimized code without being misled," ACM Trans. Program. Lang. Syst., vol. 16, no. 3, p. 387--427, may 1994. [Online].
[24]
C. Jaramillo, R. Gupta, and M. L. Soffa, "Comparison checking: An approach to avoid debugging of optimized code," in Proceedings of the 7th European Software Engineering Conference Held Jointly with the 7th ACM SIGSOFT International Symposium on Foundations of Software Engineering, ser. ESEC/FSE-7. Berlin, Heidelberg: Springer-Verlag, 1999, p. 268--284.
[25]
G. A. Di Luna, D. Italiano, L. Massarelli, S. Österlund, C. Giuffrida, and L. Querzoni, "Who's debugging the debuggers? exposing debug information bugs in optimized binaries," in Proceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, ser. ASPLOS 2021. New York, NY, USA: Association for Computing Machinery, 2021, p. 1034--1045. [Online].
[26]
Y. Li, S. Ding, Q. Zhang, and D. Italiano, "Debug information validation for optimized code," 2020.
[27]
J. Hennessy, "Symbolic debugging of optimized code," ACM Trans. Program. Lang. Syst., vol. 4, no. 3, p. 323--344, jul 1982. [Online].

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
CGO '22: Proceedings of the 20th IEEE/ACM International Symposium on Code Generation and Optimization
April 2022
348 pages
ISBN:9781665405843
  • General Chair:
  • Jae W. Lee

Sponsors

In-Cooperation

  • IEEE CS

Publisher

IEEE Press

Publication History

Published: 09 May 2022

Check for updates

Badges

Qualifiers

  • Research-article

Conference

CGO 2022

Acceptance Rates

Overall Acceptance Rate 312 of 1,061 submissions, 29%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 58
    Total Downloads
  • Downloads (Last 12 months)13
  • Downloads (Last 6 weeks)1
Reflects downloads up to 18 Feb 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media