13.07.2015 Views

Intel® 64 and IA-32 Architectures Optimization Reference Manual

Intel® 64 and IA-32 Architectures Optimization Reference Manual

Intel® 64 and IA-32 Architectures Optimization Reference Manual

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

USING PERFORMANCE MONITORING EVENTSB.7.2.6Self Modifying Code Detection14. Self Modifying Code Clear Performance Impact: MACHINE_NUKES.SMC * 150 /CPU_CLK_UNHALTED.CORE * 100A program that writes into code sections <strong>and</strong> shortly afterwards executes the generatedcode may incur severe penalties. Self Modifying Code Performance Impact estimatesthe percentage of cycles that the program spends on self-modifying codepenalties.B.7.3Branch Prediction RatiosAppendix B.7.2.2, discusses branching that impacts the front-end performance. Thissection describes event ratios that are commonly used to characterize branchmispredictions.B.7.3.1Branch Mispredictions15. Branch Misprediction Performance Impact: RESOURCE_STALLS.BR_MISS_CLEAR/ CPU_CLK_UNHALTED.CORE * 100With the Branch Misprediction Performance Impact, you can tell the percentage ofcycles that the processor spends in recovering from branch mispredictions.16. Branch Misprediction per Micro-Op Retired:BR_INST_RETIRED.MISPRED/UOPS_RETIRED.ANYThe ratio Branch Misprediction per Micro-Op Retired indicates if the code suffers frommany branch mispredictions. In this case, improving the predictability of branchescan have a noticeable impact on the performance of your code.In addition, the performance impact of each branch misprediction might be high. Thishappens if the code prior to the mispredicted branch has high CPI, such as cachemisses, which cannot be parallelized with following code due to the branch misprediction.Reducing the CPI of this code will reduce the misprediction performanceimpact. See other ratios to identify these cases.You can use the precise event BR_INST_RETIRED.MISPRED to detect the actualtargets of the mispredicted branches. This may help you to identify the mispredictedbranch.B.7.3.2Virtual Tables <strong>and</strong> Indirect Calls17. Virtual Table Usage: BR_IND_CALL_EXEC / INST_RETIRED.ANYA high value for the ratio Virtual Table Usage indicates that the code includes manyindirect calls. The destination address of an indirect call is hard to predict.18. Virtual Table Misuse: BR_CALL_MISSP_EXEC / BR_INST_RETIRED.MISPREDB-53

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!