On 11 July 2013 18:31, Eric Botcazou <ebotca...@adacore.com> wrote: >> Shrink-wrap optimization sinks some instructions for more >> opportunities. It uses DF_LR_BB_INFO (bb)->def to check whether BB >> clobbers SRC. But for ARM, gcc might generate cond_exec insns before >> shrink-wrapping. And DF_LR_BB_INFO (bb)->def does not include def info >> from cond_exec insns. So the check in function >> move_insn_for_shrink_wrap is not enough. > > Posting a testcase would be even better, but the analysis looks plausible. > DF_REF_CONDITIONAL and DF_REF_PARTIAL defs aren't killing defs so they are not > included in the def set for LR. > > As you pointed out, they are included in the gen set for LIVE if it exists, so > I guess we should wonder if we really want to do the scanning if LIVE doesn't > exist, i.e. at -O1, instead of simply giving up. In any case, the scanning
Thanks. The patch is updated based the comments: it will check GEN set of LIVE if df_live exists. Otherwise, just give up. And a testcase is included in the attached patch. -Zhenqiang > doesn't need to be redundant with the previous work, so: > > if (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL))) > continue; > > is missing in the patch. > > -- > Eric Botcazou
pr57637-updated.patch
Description: Binary data