Compiler Optimization Prediction with New Self-Improved Optimization Model

—Users may now choose from a vast range of compiler optimizations. These optimizations interact in a variety of sophisticated ways with one another and with the source code. The order in which optimization steps are applied can have a considerable influence on the performance obtained. As a result, we created a revolutionary compiler optimization prediction model. Our model comprises three operational phases: model training, feature extraction, as well as model exploitation. The model training step includes initialization as well as the formation of candidate sample sets. The inputs were then sent to the feature extraction phase, which retrieved static, dynamic, and improved entropy features. These extracted features were then optimized by the feature exploitation phase, which employs an improved hunger games search algorithm to choose the best features. In this work, we used a Convolutional Neural Network to predict compiler optimization based on these selected characteristics, and the findings show that our innovative compiler optimization model surpasses previous approaches.


I. INTRODUCTION
As per Moore's Law, the density of transistors doubles every 2 years. Compilers, on the other hand, progress at a pace of a couple percent of year. Compilers were vital tools for connecting written software to destination hardware. In the field of compilers, there's several unresolved research issues [1].Compilers play a crucial role in software development. Its core objective is to boost software productivity [2].
Compilers were liable for two tasks: translation as well as optimization. They must first effectively convert programmes into binary. Secondly, they must discover the most costeffective translation. There are numerous valid translations, each of which performs distinctively. The great majority of studies and technological activities are centered on this second performance objective, which has been referred to as optimization. The objective was mislabeled because, until recently, most people rejected obtaining an ideal translation as a difficult and impractical task [3].Compilers are now being improved so that every code block in a programmed may be transformed into an efficient application [4]. Traditional compiler optimization seems to be a difficult process with no assurances of producing the most effective and quickest target code [5].A compiler enables a multitude of code optimizations that could be activated or disabled via a compilation flag in order to enhance the throughput of compiled applications. Nevertheless, because the influence of compiler optimizations largely dependent on programme features (e.g., programme structures), the identical optimizations may not surely result in the identical runtime speed boost when implemented to various programmes [6].
Furthermore, there's an infinite range of flag combos owing to the enormous count of optimization flags. Users may find it difficult to comprehend all of the flags including their combos, and to correctly decide which flags should be activated or disabled in attempt for built programmes to attain the desired runtime performance [7].Compilers for machine learning (ML) tackle a lot of optimization issues in order to convert an ML programmed, which is often expressed as a tensor computational graph, into an efficiently executable for a hardware destination [8]. Prior efforts [9] - [14] have permitted optimizations that are implemented at the very same point in the compilation pipeline, notably the loop conversion phase. However, since compiler modifications are arranged as passes to minimize complication and also have rigorous ordering limitations, this is unfeasible in production compilers.
With a compiler's optimization capabilities influencing so many parts of product development, understanding and evaluating a compiler's optimization technology is more critical than ever. In this work, an improved optimization prediction model was created, which not only decreases computational time but also enables the compilers with faster convergence, more stable balance, and high-quality outcomes by selecting appropriate optimization. Our work made the following contributions:  Several high-level characteristics may arise from the coefficients as a result of improved entropy extraction, which boosts the compiler optimization prediction.
 An Improved Hunger Game Search optimization was proposed to provide a very competitive performance to the compiler with less computational time.
The following is the flow of this article: Section II covers some previous relevant research, Section III gives a brief presentation of our proposed compiler optimization prediction model, Section IV gives the outcomes of our work, and Section V contains the conclusion, while the following section includes the references for this work. www.ijacsa.thesai.org II. RELATED WORKS AND REVIEW Some of the researches presented by various researchers on compiler optimization were reviewed here.
Hui et al. [15] presented the ALIC iterative compiler optimization parameters estimation model, which has minimal overheads. Firstly, the target programmes were defined using static-dynamic characteristics format depending on feature significance, as well as an early optimization prediction model was built using the classifier. Subsequently, for every sample, a dynamic amount of sample observation methodology was being used. The most beneficial test from the collection of candidate samples typically the chosen and labeled with each mark increase the count of sample data. The optimization prognosis system is then built by using intermediate prediction network, which actively learns candidate samples.
Tiago et al. [16] suggested a new exploration approach to determine a compiler optimization strategy. This hybrid methodology utilizes previously created sequences for a series of training programmes in order to uncover optimizations as well as their deployment order. A clustering method selects optimizations during the first stage, and then a metaheuristic algorithm determines the order wherein the compiler would execute every optimization in the latter. The LLVM compilers as well as an I7 processor have been used to assess this strategy.
Supun et al. [17] developed HUMMINGBIRD, a unique prototype scoring technique that incorporates featurization operators with classic ML designs (e.g., decision trees) into a limited collection of tensor operational processes. This method decreases infrastructure overhead by using current investments in Neural Net compilers but also runtimes to produce efficient calculations for both CPU as well as hardware accelerators. The findings indicate that HUMMINGBIRD performs compatible.
Mircea et al. [18] introduced MLGO1, a methodology for comprehensively incorporating machine learning methods into an industrial compiler-LLVM. It's the first time ML has been fully integrated in a sophisticated compiler run in a real-world context. It's in the LLVM main repository. As contrasted to the state-of-the-art LLVM -Oz, we apply two alternative ML techniques to train the inlining-for-size method: Policy Gradient as well as Evolutionary Algorithms.
Aleksandar et al. [19] presented a revolutionary JIT compiler inlining approach that gradually investigates a program's call network and switches between inlining as well as optimizations. Three new heuristics have been developed to steer this inliner. Graal, a dynamic JIT compiler for the HotSpot JVM, was used to create this technique. Benchmarks such as Java DaCapo, Scalabench, and others were utilized to test the suggested algorithm.
Conventional systems to prediction model creation frequently employ a random selection search strategy, which can often lead to information redundancy. Moreover, the sample program gets exposed to a fixed number of repetitive measurements due to the influence of run-time disturbances. Unfortunately, if there are few sounds, the recurrent measurements will lead to a significant loss of iterative compilation time overheads. Decreasing iterative compilation overheads and predicting an appropriate compiler optimization with less computational time and increased compiler performance was still challenging.

III. PROPOSED COMPILER OPTIMIZATION PREDICTION MODEL
This proposed compiler optimization model comprises three working phases: model training, feature extraction [24,25], as well as model exploitation (feature selection). First, the inputs were fed into the model training phase, which tries to match the right weights as well as bias to a learning algorithm [26,27] in order to minimize a loss function throughout the validation range. The retrieved characteristics, such as static, dynamic, as well as improved entropy, were then transferred to the model exploitation phase [21], where the optimal features were chosen utilizing the improved chaos game optimization. These optimized features were given to Convolutional Neural Network for prediction of compiler optimization. The architecture of our improved compiler optimization prediction model is given in Fig. 1.

A. Model Training Phase
The initialization and candidate sample set generation takes place in the model training phase. The initialization model will be built in the training set with some labeled samples. The initialization model will be used as the intermediate prediction

B. Feature Extraction
Outputs from model training phase were given to the feature extraction phase to extract the static, dynamic and improved entropy features [26,27].

1) Static features:
The values of static features do not vary over time and are set for every sample. The lists of the static features extracted in this work were shown in Fig. 2.
2) Dynamic features: The values of dynamic features fluctuate over time and are not constant. Fig. 3 depicts the dynamic characteristics retrieved in this work.
3) Improved entropy feature extraction: The count of coefficients is generally so large that it is challenging to utilize them directly as features for categorization or prediction. As a result, several high-level features might emerge from these coefficients for improved prediction. Entropy seems to be a tool for measuring the uncertainty of data content in specific mechanisms, and it is frequently employed in signal analysis, pattern recognition, pattern matching, and other fields. . Some kinds of entropy include Shannon entropy (SE), log energy entropy (LEE), Renyi entropy (RE), as well as Tsallis entropy (TE). Renyi entropy is utilized to retrieve features from input data in this work. Entropy may be estimated via energy. Wavelet energy, described as Eq. (1), will be used to assess the data of the coefficient a of the b-th node at the c-th level.
The total energy for the b-th node at the c-th level may then be determined utilizing Eq. (2) , Where M indicates the number of node matching coefficients Eq. (3) may be used to compute the probability of the c-th coefficient at its associated node: Where the sum of , , a b c  equals 1.
Renyi Entropy of order q(q ≥ 0 and q 6= 1) gets described as The parameter of q in RE should be optimized to provide better results. In our work, the improved entropy features were extracted using the eq. (5)  Here a  denotes the weight, which is calculated by Following the calculation of the entropy of each terminal node, the entropies of all terminal nodes are concatenated to form a feature vector. These features were sent to the model exploitation phase for feature selection.

C. Model Exploitation
The feature selection procedure is taking place during this model exploitation phase. When creating forecasting models, feature selection is the technique of minimizing the count of input variables. It is preferable to limit the count of input variables in order to reduce modeling computational costs and, in certain situations, increase model performance. For that reason we used an improved HGS Optimization.

1) Improved Hunger Game Search (IHGS) Optimization:
The HGSO technique is influenced by normal animal behaviors including terror of being eaten by predators as well as hunger. The mathematical modelling of the HGSO strategy is explained in this portion of the publication. The modelling is based on social selection and hunger-driven behaviour.
This section quantitatively models the approaching behaviour of hunger. Eq. (7), which explains the foraging hunger as well as individual supportive communication activities, contains the game instructions. The contraction mode is imitated by the mathematical formula in Eq. (7).
where ( ) Z t signifies the location of all individuals, d Z indicates the position of the best individual, 1 . W and 2 W seem to be hunger weights of hunger, R  is between [-a, a], r1 and r2 seem to be random numbers between [0, 1], randn(1) denotes a normal distributed random number, and t seems to be the count of current iterations. The parameter l represents the HGSO algorithm's control variable that governs the algorithm's sensitivity. H stands for variation control for all locations.
2) Opposite behavior learning: Amongst the most effective instructional procedures, opposition-based learning (OBL), has been extensively embraced as an excellent learning phase to improve the searching capabilities of algorithms. When assessing a solution Y to a given issue, a novel opportunity will be gained that brings the candidate solution closer to the optimal solution if the opposing solution of Y is estimated at the same time. The opposing number as well as opposite point notions were described as follows.
OBL is a learning approach that is centered on the inverse number iteration. An opposing point in several dimensions has been described as (9) In our work, to generate chaotic opposite solution we have used the following equation (10) Here rand was generated using the sine map.
Variation control for all positions H stated in eq. (12) where F(i) represents the cost function value of every population, I = 1, 2,..., n, BF represents the best cost function value acquired during the latest incarnation, and Sech represents the hyperbolic function and thus is equal to .
In our work, we used the reciprocal of the hyperbolic function Csch,which is expressed in eqn., (13) Here Eqn., (14) (19) where new H has been constrained to a lower bound LH, ra would be a random number among [0, 1], WF as well as BF seem to be the worst best fitness acquired during the latest iteration, respectively, F (k) has become the fitness of every population, ra6 would be a random number between [0, 1], and LB as well as UB are indeed the lower and upper boundaries of the dimensions, respectively. The selected features were sent to the CNN for compiler optimization prediction.

D. Prediction using CNN
Convolutional networks were deep training strategies that extract information from input pictures by convolving them with filters or kernels. Convolution of a GCG picture with a S S f Cf filter learns the same characteristic on the whole picture. After each action, the window moves, and the feature maps learn the characteristics. The feature maps record the image's local receptive area and operate with mutual weights as well as biases. Equation (20) depicts the output matrix size without padding, whereas Equation (21) depicts the convolution procedure. Padding has been utilized to keep the size of the given picture constant. The output picture size is the same as the input image size in a 'SAME' padding, and there is no padding in a "VALID" padding. Equation depicts the output matrix size with padding (22).
Here, O is the output, P is the padding, S is the stride, m is the bias, σ is the sigmoidal activation function, w is a 3x3 weight matrix of shared weights and 1, 2 p p  is the input activation at position p1,p2. The output O provides the prediction results.

A. Simulation Setup
The unique methodology for compiler optimization utilizing IHGS was implemented in Python. The standard performance evaluation group created the SPEC CPU2006 training set to evaluate general-purpose CPU performance [20].
The input scale of the SPEC2006 benchmark may be split into test, train, as well as reference scales; we utilize the reference scale to test." In this case, analysis was performed for multiple measures such as accuracy [22,23] and error metrics such as MSE, MSLE, and so on. In addition, IGHS outperformed the HGS, PRO, CMBO, ARCHOA, DO, as well as GOA models.

B. Performance Analysis
The research on diverse metrics including accuracy, sensitivity, specificity as well as precision was detailed here. Here, the analysis was done for LPs (Learning Percentages) of 60, 70, 80 and 90 over HGS, PRO, CMBO, ARCHOA, DO, GOA models which is shown in Fig. 4. For 60 LP, CMBO and HGS achieve the accuracy rate of 0.69 and 0.76 whereas our proposed IHGS model achieves the accuracy rate of 0.84. At 80 and 90 LPs our proposed IHGS achieves the accuracy rate of 0.9 and 0.94 which is higher than other models. When our proposed IHGS achieves the precision value of 0.9, ARCHOA, CMBO models achieves only 0. The cost function for 0-50 iterations was evaluated in this work, to assess the performance of our proposed IHGS model which is shown in Fig. 6(a). When cost function of CMBO is 1.074, our proposed method obtains the value of 1.052 for iteration 0 whereas 1.058 and 1.062 for GOA method which states that IHGS method has the lowest cost function for all five iterations. A more trustworthy statistical rate known as the Matthews correlation coefficient (MCC) was evaluated, which yields a high score only if the prediction performed well in all the confusion matrix classes which are given in Fig. 6(b). MCC values of all the LPs were 0.67, 0.68, 0.7 and 0.9 for our proposed IHGS method which proves our prediction was performed well with good results.
The F-measure is derived as the harmonic mean of accuracy as well as recall, with equal weighting for each. It enables a system to be assessed utilizing a single score that accounts for both accuracy and recall that is useful for reporting system performance as well as comparing models. With F1 measure, fnr, fpr, as well as npv values were also estimated and compared with conventional models which is shown in Fig. 7. In comparison to the CMBO as well as ARCHOA approaches, our proposed IHGS method achieves f1 measure values of 0.9, 0.92, 0.93, and 0.95 for all LPs. The IHGS approach produces anpv value of 0.92 for 90 LP, whereas the CMBO and ARCHOA methods yield relatively low values such as 0.6 and 0.68. Our proposed IHGS technique achieves fpr values of 0.13, 0.12, 0.11, and 0.05, and assessed fnr values of 0.13, 0.12, 0.11, and 0.04, which are lower than other traditional methods, demonstrating that IHGS method achieves superior performance than other methods.  The computation time for each method which is compared with our proposed IGHS method is shown in Table I which shows that IGHS method have low computational time of 55.64. Accuracy and error matrices also compared with without optimization, to evaluate the performance of our proposed IGHS method which is given in Tables II and III. Without optimization our proposed method achieves only 88% accuracy whereas, with optimization it achieves 95% accuracy.   V. CONCLUSION Selecting the optimal, or even a good, combination of optimizations for an unpredictable programmed on an arbitrary design is a task so tough that traditional manual analysis approaches are impractical. For that reason, a novel optimization prediction model with improved optimization was developed in this work, which has three working phases including model training, feature selection as well as feature exploitation phase. First, the inputs are being sent to the model www.ijacsa.thesai.org training phase that aims to link the appropriate weights as well as bias to a learning algorithm in order to minimize a loss function throughout the validation range. The retrieved characteristics, including static, dynamic, and enhanced entropy, were then transferred to the model exploitation phase, where the best features was determined using the improved chaos game optimization. These improved characteristics were fed into a Convolutional Neural Network to predict the appropriate compiler optimization.