On Thu, Oct 22, 2015 at 04:17:32PM -0400, Nathan Sidwell wrote: > On 10/22/15 04:04, Jakub Jelinek wrote: > > >>+ /* Ignore blocks containing non-clonable function calls. */ > >>+ for (gsi = gsi_start_bb (CONST_CAST_BB (bb)); > >>+ !gsi_end_p (gsi); gsi_next (&gsi)) > >>+ { > >>+ g = gsi_stmt (gsi); > >>+ > >>+ if (is_gimple_call (g) && gimple_call_internal_p (g) > >>+ && gimple_call_internal_unique_p (as_a <gcall *> (g))) > >>+ return true; > >>+ } > > > >Do you have to scan the whole bb? E.g. don't or should not those > >unique IFNs force end of bb? > > What about adding a flag to struct function? > > /* Nonzero if this function contains IFN_UNIQUE markers. */ > unsigned int has_unique_calls : 1; > > Then the tracer could either skip it, or do the search? > > (I notice there are cilk flags already in struct function, instead of the > above, we could add an openacc-specific one with a similar behaviour?)
If you want to force end of a BB after the IFN_UNIQUE call, then you can just gimple_call_set_ctrl_altering (gcall, true); on it, and probably tweak gimple_call_initialize_ctrl_altering so that it does that by default. Plus of course split the blocks after it when you emit it. Jakub