Graph coloring register allocation

If the register allocation problem is abstracted into a graph coloring problem, then each node in the graph represents the active period or lifetime (Live range) of a certain variable. The definition of the active period starts from the first time the variable is defined (assigned) to the last time it is used before the next assignment. The edge between two nodes indicates that the active periods of these two variables conflict or interfere with each other due to overlapping lifetimes. Generally speaking, if two variables are live at a certain point in the function, they conflict with each other and cannot occupy the same register.

For details, please refer to: https://zhuanlan.zhihu.com/p/55287942

 

Guess you like

Origin blog.csdn.net/zilan23/article/details/104062522