http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44025

--- Comment #4 from amker.cheng <amker.cheng at gmail dot com> 2011-11-02 
06:03:56 UTC ---
I noticed that for attached reduced test case "reduced_test.c",
cse pass can eliminate such redundant load constant instructions.
But since cse works on extended basic block, rather than globally,
it can do nothing for the original case.

The questions are:
1, why pre does not do such optimization;
2, if pre does do the work, surely the live range of r0 is extended, which
might harm the register allocation;

Also I found the regcprop.c, which is a peephole pass eliminates redundant
register moves. It should be able to work for redundant constant load insns if
:
a) extend it in a value numbering way, at least for these constant values;
b) extend it in a global data analysis way;

Such change might also impact the scheduling pass and I am not sure how is the
benefit for common codes.

Reply via email to