LTO streaming of TARGET_OPTIMIZE_NODE
Jan Hubicka
hubicka@ucw.cz
Thu Nov 13 15:32:00 GMT 2014
> >
> > Incrementally I would like to handle optimizations nodes same way and change
> > streaming format to be a set of assignments field_name=value.
> > This way we could behave sanely when some field is introduced or removed by
> > either defaulting it or ignoring it.
>
> I'm not sure that idea is good ;) Adding a version / checksum to
> detect a mismatch early would be nice though. Maybe just compute
> a hash for the fields in the AWK script?
OK, lets see how to handle it incrementaly.
>
> > Bootstrapped/regtested x86_64-linux, seems sane?
>
> Sounds sane - I'd like to have a AWK capable person have a look
> for non-portable stuff (did you check AIX? ;))
Good idea, will do today :)
Basically all the AWK is cut&paste from the way save loop is generated, no
really new constructs in it.
> > + if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
> > + cl_target_option_stream_in (ib, data_in, TREE_TARGET_OPTION (expr));
> > +
> > if (code == OMP_CLAUSE)
> > lto_input_ts_omp_clause_tree_pointers (ib, data_in, expr);
>
> Any reason you don't use bitpacks and stream it from
> [un]pack_value_fields? We can happily pack strings there as well.
> The 'body' streaming is for tree pointers only.
Hmm, I did not notice we have pack_string. Will go with bitpacks then.
> > @@ -963,6 +960,9 @@ streamer_write_tree_body (struct output_
> > if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR))
> > write_ts_constructor_tree_pointers (ob, expr, ref_p);
> >
> > + if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
> > + cl_target_option_stream_out (ob, TREE_TARGET_OPTION (expr));
> > +
> > if (code == OMP_CLAUSE)
> > write_ts_omp_clause_tree_pointers (ob, expr, ref_p);
> > }
>
> Otherwise looks good.
OK, I will update the changes above and test AIX today.
Incrementally I will send patch to disable the TARGET_OPTION_NODE regeeneration from attribute
and to stream TARGET_OPTION_NODE for all functions (this is tested on firefox and AIX by now
and works).
For optimization node I think I can follow exactly the same strategy (to avoid writting binary blobs
that are not portable). I plan to add Ipa and Late modifiers to the format to annotate flags that
affects only Ipa or Late codegen/optimization (ltrans). This way we can add comparers for inliner
ignoring the flags that are not marked Late and streamer that streams only Ipa/Late.
If this plan sounds sane, I can do it today I believe.
Across stage3 early stage3 I can update IPA passes to not check global flags during LTO so
we can support correctly support different LTO flags (like -fno-inline) in the optimization
nodes...
Honza
>
> Thanks,
> Richard.
More information about the Gcc-patches
mailing list