public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* ln -r and cherry picking.
@ 2008-06-06 15:30 Kenneth Zadeck
  2008-06-06 15:34 ` Arnaud Charlet
  2008-06-06 20:18 ` Cary Coutant
  0 siblings, 2 replies; 6+ messages in thread
From: Kenneth Zadeck @ 2008-06-06 15:30 UTC (permalink / raw)
  To: gcc, Diego Novillo, Ollie Wild, Maddox, Bill, Zadeck, Kenneth,
	Rafael Espindola, Hubicha, Jan

I want to point out that the current implementation of lto is not
compatible with "ln -r", and will need to be modified to support
"cherry picking" the function bodies.

In the current implementation, each lto section (such as what holds
a function body or the streamed information from an ipa pass)
references an index that is unique to that .o file.  This index allows
the encoding of the function body or the ipa information to use small
integers to reference the global types and declarations.

"ln -r" will not work in the current system for two reasons:

  1) The ipa passes currently just read the ipa sections until they
  hit their "end of file marker".  Assuming that we create these
  section with attributes to tell "ln -r" to concatenate them (I have
  no idea how to do this but I assume it is easy), the ipa pass's
  stream readers will need to modified to restart after the end of
  file marker and do this until the number of bytes in the section is
  exhausted.  This should only require wrapping them in an extra loop.

  2) LTO sections need to be able to find "their index" of decls and
  types.  By "their index" I mean the index that each section used to
  reference the decls and types when the section was generated.

  There is currently no identifying fingerprint in a .o file to match
  an index with the sections that need it.  Note that the indexes for
  different .o files are (obviously) different.  We will need to add a
  fingerprint for each .o file so that when sections from different .o
  files are merged, we can match a section with the proper index.  I
  currently do not know how to generate a finger print.  I assume some
  string with the name of the machine, the process id and the time is
  what we want, but the right answer could also be something like the
  md5 checksum of some large part of the .o file.   

(2) is also an issue for the cherry picker to deal with, because the
picker is not only going to have to cherry pick but it is going to
have to regenerate all of the indexes based on how the decls and types
are merged.

Note that having this index external to the section that holds a
function body is the only way for the cherry picking to work without
having the function bodies modified.  If explicit references to the
decls and types were in the function bodies, you would have to rewrite
the function bodies to make them point to the proper merged type or
decl.

I do not want to tackle either of these tasks until the streaming lto
branch is merged into the lto branch, but this is certainly something
that will need to be done.

Kenny

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-06-06 21:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-06 15:30 ln -r and cherry picking Kenneth Zadeck
2008-06-06 15:34 ` Arnaud Charlet
2008-06-06 15:40   ` Kenneth Zadeck
2008-06-06 20:18 ` Cary Coutant
2008-06-06 20:53   ` Kenneth Zadeck
2008-06-06 21:08     ` Cary Coutant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).