This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 0003-Improve-VBEout-computation.patch


On 06/16/10 09:56, Maxim Kuvyrkov wrote:
Code hoisting algorithm from Muchnick, which is the one implemented in GCC, has a quirk in that it does include expressions calculated in basic block in its VBEout set. This seems odd to me; if an expression is calculated in BB and is available at BB's end, then we do want to hoist expressions from BB's successors to the end of BB. This patch implements this.

The patch also adds an open-ended comment which describes another possible improvement to the algorithm.
I think the comment that has sparked the confusion needs to be removed as the proposed optimization is incorrect, at least in cases where the expression may trap.


+ /* Enable if debugging VBE data flow problem. */ + if (dump_file && 0) + { + fprintf (dump_file, "vbein (%d): ", bb->index); + dump_sbitmap_file (dump_file, hoist_vbein[bb->index]); + fprintf (dump_file, "vbeout(%d): ", bb->index); + dump_sbitmap_file (dump_file, hoist_vbeout[bb->index]); + }

ISTM you should move this code to the end of compute_code_hoist_vbeinout and have it iterate over each block -- you don't want to dump the VBE state at each transition change, ISTM you want to dump the vbein/vbeout for each block when the solution is complete.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]