Font Size: a A A

The Design And Implementation Of The Front-end Of Global Optimization Framework For Numerical Programs Based On Rose Compiler

Posted on:2022-04-18Degree:MasterType:Thesis
Country:ChinaCandidate:Y Z LiFull Text:PDF
GTID:2480306725484254Subject:Master of Engineering
Abstract/Summary:PDF Full Text Request
THESIS: The Design and Implementation of the Front-end of Global Op-timization Framework for Numerical Programs Based on ROSECompiler SPECIALIZATION: Software Engineering POSTGRADUATE: Yaze Li MENTOR: Associate Professor Enyi TangAbstractNumerical programs are usually used in important fields such as national defense and aerospace that have extremely high requirements for reliability.Therefore,it is fun-damental to ensure the accuracy of numerical calculation results in numerical programs.However,it is extremely difficult to write a numerical program with high-precision cal-culation results.This is because there is a natural rounding error between the floating-point number used by the computer when processing numerical calculations and the real number it actually represents.Then the rounding error will be accumulated in the process of floating-point operations,eventually leading to inaccurate calculation results of numerical programs.Only numerical programs carefully designed and written by ex-perts in the numerical field can maintain high-precision calculation results.However,with the continuous expansion of the application range of numerical programs,the tra-ditional methods which rely on experts in the numerical field to optimize numerical programs has gradually become unable to meet the requirement.Therefore,we pro-pose a global optimization framework for numerical programs,so that developers who do not have professional knowledge in the numerical field can write numerical pro-grams directly based on mathematical logic alone.The framework can automatically extract the global expression of numerical calculation in the program and rewrite it into a form with a smaller rounding error,thereby automatically converting the numerical program into an equivalent program with higher precision.Having a fully functional front-end is critical to a global optimization framework.The main responsibility of the front-end is to analyze the source code of the numerical program and extract the global execution path of the numerical calculation in the source code on this basis,which is the key to make the framework have global optimization capability.Most of the existing numerical program optimization frameworks adopt local optimization strategy,which often leads to poor optimization results because the numerical calculation information represented by a single statement or expression is too fragmented.The front-end of the framework processes the numerical program to be optimized as a whole to extract the global numerical calculation expression of the program,so that the framework can globally optimize the numerical calculation code in the program,so as to obtain better optimization effect than local optimization.This thesis designs and implements the front-end of the global optimization frame-work for numerical programs based on ROSE Compiler,and mainly completes the fol-lowing tasks:· Analyze the source code of the numerical program line by line.We use staticanalysis technology to locate the code involving numerical calculation logic inthe program,analyze whether there are special structures such as loop and branchselection in the program,and generate a global function call graph of the program· Construct the program into segments.We formulate a segmentation strategy toavoid the problem that the correctness of the numerical program cannot be en-sured during the global optimization process.At the same time,we construct thesegments into compilable source files,so that each segment can be regarded asan independent program to be globally optimized.· Perform path extraction on segments.We extract the execution paths of the nu-merical calculation code in each segment through symbolic execution technologyand output the execution path set of each segment.We also design the abstractrepresentation of the loop and recursive structure,so that the execution path ex-plosion will not occur when the segmental path containing loop and recursivestructure is extracted.· Output IR(Intermediate Representation)files.We output the relevant informationobtained in the program analysis,segment construction and path extraction workin XML format and transfer it to the back-end to realize the interaction betweenthe front-end and back-end of the framework.At the same time,we store theinformation output by the front-end work persistently.Through the above four aspects of work,the front-end realizes the functions of analyzing the source code of the numerical program,constructing the program into segments,extracting the execution path set of each segment and generating the IR file that interacts with the back-end,so that the entire framework can have the capability to globally optimize numerical programs.
Keywords/Search Tags:Numerical Calculation, Global Optimization, Static Analysis, Symbolic Execution
PDF Full Text Request
Related items