On Mon, Jan 05, 2015 at 10:23:57PM +0100, Jakub Jelinek wrote: > On Mon, Jan 05, 2015 at 03:16:46PM -0500, John David Anglin wrote: > > I think there may be one situation after reload that's not handled > > by the above. frame_read is only used for const calls. What about > > the situation where we have a non const sibcall and the frame pointer > > isn't eliminated? > > After reload DSE is run after threading prologues/epilogues, end > the prologue/epilogue sequences usually contain wild reads, e.g. > (mem:BLK (scratch)) in some insn etc. > Do you have some particular testcase in mind? > > That said, DSE after reload is much more limited than the DSE before reload, > so is less important, so perhaps even > if ((HARD_FRAME_POINTER_IS_ARG_POINTER || reload_completed) > && SIBLING_CALL_P (insn)) > { > add_wild_read (bb_info); > > return; > > } > might be good enough.
Or you could e.g. do the if (HARD_FRAME_POINTER_IS_ARG_POINTER && !reload_completed && SIBLING_CALL_P (insn)) { add_wild_read (bb_info); return; } case first, then compute const_call and memset_call, if (const_call || memset_call) { current_big_block } else if (reload_completed && SIBLING_CALL_P (insn)) add_wild_read (bb_info); else add_non_frame_wild_read (bb_info); That way, you would not punish const/memset calls unnecessarily after reload when they are sibling calls. Jakub