Upload
acton
View
50
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Machine Learning in Compiler Optimization. By Namita Dave. Overview. What are compiler optimizations? Challenges with optimizations Current Solutions Machine learning techniques Structure of Adaptive compilers. Introduction. - PowerPoint PPT Presentation
Citation preview
Machine Learning in Compiler
OptimizationBy Namita Dave
OverviewWhat are compiler optimizations?Challenges with optimizationsCurrent SolutionsMachine learning techniquesStructure of Adaptive compilers
IntroductionOptimization refers to process of modifying to
achieve maximum efficiency in terms of storage, cost or time.
Machine learning techniques can be effectively used for optimizing based on specifics of program and target platform
ChallengesInherently hard ProblemsInteractions between optimizations
Inherently hard problemsDue to the interaction of compiler optimization
with the hardwareExample – Register allocation
Interaction between optimizations
There can be positive or negative interactionsIt depends in the order in which optimizations
are appliedPositive Interaction Example
GCSE and Loop unrollingNegative interaction example
Instruction scheduling and Register allocation
Instruction Scheduling vs Register Allocation
z = x[i] tmp = x[i+1+n]
Pre pass Post Pass
Current SolutionsEmploy Heuristics
To decide whether to apply an optimization or notExample – In lining decisions
Phase orderingTo decide the sequence of optimizations so as to
minimize negative interactions
Typical Optimizing compiler
Problem?Compiler Heuristics and Phase ordering is
manual and predeterminedThe solution needs to be dependent on specifics
of program and the target platform
SolutionUsing machine learning techniques, a near optimal solution can be developed.
Heuristic selectionMachine learning techniques like supervised
classification, function approximation and function selection can be employed for heuristic selection
Example Supervised classification can be used to predict
best unroll loop factorGenetic programming can be used for learning
priority functions
Automatic Phase OrderingUnsupervised learning techniques can automate
phase orderingBased on the notion of similarity of programsOffline training data can be used to identify a
set of best phase orderings for similar programsBased on feature vectors, similar programs can
be found for a given new program
Structure of Adaptive compiler
Thank You