This is the mail archive of the
mailing list for the GCC project.
Rematerialization and Live Range Splitting on Region Frequency
- From: Ajit Kumar Agarwal <ajit dot kumar dot agarwal at xilinx dot com>
- To: "vmakarov at redhat dot com" <vmakarov at redhat dot com>, "law at redhat dot com" <law at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: Vinod Kathail <vinodk at xilinx dot com>, Shail Aditya Gupta <shailadi at xilinx dot com>, Vidhumouli Hunsigida <vidhum at xilinx dot com>, "Nagaraju Mekala" <nmekala at xilinx dot com>
- Date: Sun, 25 Jan 2015 09:55:13 +0000
- Subject: Rematerialization and Live Range Splitting on Region Frequency
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 126.96.36.199) smtp dot mailfrom=ajit dot kumar dot agarwal at xilinx dot com; gcc.gnu.org; dkim=none (message not signed) header.d=none;
Looks like Live range splitting and rematerialization are connected to each other. If the boundary of Live range
Splitting is in the high frequency of the region then the move connected to splitted live ranges are inside the
High frequency region which is the performance bottleneck for many benchmarks.
Live range splitting based on the frequency of the region should be considered. The Live range splitting in the
High frequency region is beneficial if the splitted live range is assigned the color(hard registers) which is better
Spilling inside the high frequency region, although there will be move instruction or shuffle code which is still
Better. If one of the splitted live range does not have any use points and all the partner live ranges gets the
Hard register, then the move instruction due to splitting will be costly for the high frequency region. In such
Case the split point should be move up at the boundary of the transition from low frequency region to high
Frequency region, and the splitted live ranges still get hard registers. This require increment check of
colorabity which increases the compile time but beneficial with respect to run time. The above heuristic should
be incorporated on top of the below Live range splitting Algorithm. Live range splitting algorithm should consider
the blocks in the decreasing order of frequency with the first block should be taken from the high frequency
region and incrementally updates till it become colorable. Thus split points should be at the edge of the transition
from high frequency to low frequency region or from low frequency region to high frequency region.
The above Live range splitting should be incorporated for all the flavors of Graph Coloring.
Regarding the rematerialization the Chaitin's Rematerialization try to recalculate the expression at all the
Use points of the Live ranges and Simpson based approach for Rematerialized try to move the arithmetic
Instruction lower to use points or the basic blocks considering the operands of Arithmetic instructions is
Not touched along the blocks of the Live range.
Considering all the effects of rematerialization, The remat point or the recalculation should be done at the
split points instead of Chaitin's approach of remat at every use points and the Simpson approach of operands
not being touched upon and the movement of arithmetic instruction later at the use points.
The above approaches looks feasible to implement consider the high frequency region into consideration.
Thoughts Please ?
Thanks & Regards