Abstract
Function reordering optimization is a way how compiler optimizes a program. It reorders memory address of every function in executable file, in order to decrease I-Cache miss when running a program and it’s equal to improve cache locality. In this paper, we aim at large-scale software, and collect larger data such as metadata provide by LLVM and sampling profile provide by Perf. After data analysis, we can get the weight of nodes and edges of call graph, and optimize more precise by property of LLVM. Relative to traditional compiler, it data for optimization is relative few, so we can utilize more information to improve process performance. Our reordering algorithm makes use of the graph to decide how to reorder a function; in addition, it’s also simple and easy to understand. Experimental environment mentioned in this paper builds in X86. The final result can improve 10% in time performance relative to O0 and 5% to O3.