[Open64-devel] Question on Aliases & register promotion
Brought to you by:
ributzka,
suneeljain
From: Peng Z. <pen...@cs...> - 2004-09-11 20:17:31
|
Hi, BB1 / \ BB2 BB3 \ / BB4 Let's consider the above dimond shape in a CFG. Assume BB1->BB2->BB4 is a very hot path and BB3 is rarely touched. And in BB3, there is a function call my_call(&V). V is used in all the four BBs and its address is passed to my_call() in BB3. This inter-procedural alias relationship makes it unsafe to keep V in registers. ORC is smart in that it tries to put V in register and then spill it to memory when possible. However, if without frequency information, ORC might spill V in the hot paths. For example, I found that ORC keeps spilling V at the end of BB1, causing lot more instructions and performance penalities. It would be much better to spill V in BB3 (just before the function call my_call()). Can somebody tell me how ORC makes the decision on where to spill a varialbe because of aliases? And where is it implemented in ORC? Why doesnot ORC spill V as close to the call site (therefore in BB3) as possible? Is there anyother factors considered or the compiler is at a total different perspective with me? Thanks. |