[PATCH] Get TargetOptions after parseCodeGenDebugOptions in LTO

Tom Roeder tmroeder at google.com
Tue Jun 17 11:39:45 PDT 2014


This patch adds calls to InitTargetOptionsFromCodeGenFlags after the
call to parseCodeGenDebugOptions. It then passes a
correctly-filled-out TargetOptions to LTOCodeGenerator. There are
currently calls to get the TargetOptions before LTOModule creation,
but this only gets the default versions of the options, since gold
doesn't pass the extra options down to lto early enough: the calls
lto_codegen_debug_options don't happen until all_symbols_read_hook in
gold, which happens after all the modules have been read, IIUC.

AFAICT, this currently doesn't lead to any problems with
TargetOptions, but it's a little odd, since LTOModule needs
TargetOptions in its constructor, but the arguments that specify
non-default versions of TargetOptions haven't been passed to LTO yet.

Maybe the right fix is to move the call to lto_codegen_debug_options
earlier in gold? Can someone who knows the sequence of calls in gold
fill me in?

Thanks,

Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lto_options.patch
Type: text/x-patch
Size: 1142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140617/9bf63a92/attachment.bin>


More information about the llvm-commits mailing list