This is the second version. Concern was renamed to component, and all other comments were addressed (I hope). It still uses only two bitmaps for the component placement, but now they are called needs_components and has_components, which hopefully is easier to follow. The "can this prologue be moved earlier for no cost" test is generalised a bit, and the cost estimate explicitly excludes backedges, which makes it easier to see that prologues will not be placed inside a loop if there is no benefit to that (I didn't see any different generated code because of this change). And new and updated comments all over, of course.
Is this okay for trunk? Segher gcc/cfgcleanup.c | 5 + gcc/common.opt | 4 + gcc/config/rs6000/rs6000.c | 257 ++++++++++++++++- gcc/dce.c | 9 + gcc/doc/invoke.texi | 11 +- gcc/doc/tm.texi | 54 ++++ gcc/doc/tm.texi.in | 29 ++ gcc/emit-rtl.h | 4 + gcc/function.c | 15 +- gcc/regcprop.c | 4 + gcc/regrename.c | 13 +- gcc/sel-sched-ir.c | 1 + gcc/shrink-wrap.c | 705 +++++++++++++++++++++++++++++++++++++++++++++ gcc/shrink-wrap.h | 1 + gcc/target.def | 57 ++++ 15 files changed, 1150 insertions(+), 19 deletions(-) -- 1.9.3