DocumentCode :
2686023
Title :
The effect of code reordering on branch prediction
Author :
Ramirez, Alex ; Larriba-Pey, Josep L. ; Valero, Mateo
Author_Institution :
Univ. Politecnica de Catalunya, Barcelona, Spain
fYear :
2000
fDate :
2000
Firstpage :
189
Lastpage :
198
Abstract :
Branch prediction accuracy is a very important factor for superscalar processor performance. The ability to predict the outcome of a branch allows the processor to effectively use a large instruction window, and extract a larger amount of Instruction Level Parallelism (ILP). In this paper we will examine the effect of code layout optimizations on branch prediction accuracy and final processor performance. These code reordering techniques align branches so that they tend to be not taken, achieving better instruction cache performance and increasing the fetch bandwidth. Here we focus on how these optimizations affect both static and dynamic branch prediction. Code reordering mainly increases the number of not taken branches, which benefits simple static predictors, which reach over 80% prediction accuracy with optimized codes. This branch direction change produces no effects on dynamic branch prediction: on the positive side, trades negative interference for neutral or positive interference in the prediction tables; on the negative side, it causes a worse distribution of the Branch History Register (BHR), causing many possible history values to be unused. Our results show that code reordering reduces negative Pattern History Table (PHT) interference, increasing branch prediction accuracy on small branch predictors. For example, a 0.5 KB gshare improves from 91.4% to 93.6%, and a 0.4 KB gskew predictor from 93.5% to 94.4%. For larger history lengths, the large amount of not taken branches can degrade predictor performance on dealiased schemes, like the 16 KB agree predictor which goes from 96.2% to 95.8%. But processor performance not only depends on branch prediction accuracy. Layout optimized codes have much better instruction cache performance, and wider fetch bandwidth. Our results show that when all three factors are considered together; code reordering techniques always improve processor performance. For example, performance still increases by 8% with an agree predictor; which loses prediction accuracy, and it increases by 9% with a gshare predictor, which increases prediction accuracy
Keywords :
parallel architectures; performance evaluation; program compilers; Instruction Level Parallelism; branch prediction; code layout optimizations; code reordering; fetch bandwidth; instruction cache performance; processor performance; superscalar processor; Accuracy; Bandwidth; Contracts; Degradation; History; Information analysis; Interference; Performance loss;
fLanguage :
English
Publisher :
ieee
Conference_Titel :
Parallel Architectures and Compilation Techniques, 2000. Proceedings. International Conference on
Conference_Location :
Philadelphia, PA
ISSN :
1089-795X
Print_ISBN :
0-7695-0622-4
Type :
conf
DOI :
10.1109/PACT.2000.888343
Filename :
888343
Link To Document :
بازگشت