<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="color:rgb(80,0,80)">> I often use the gold plugin's also-emit-llvm option to verify the final LLVM</span></blockquote>

<div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


bitcode of a program. However, I realized that the gold plugin generates the<br>
bitcode file before running LTO optimizations, such that the changes performed<br>
by LTO are not reflected in the bitcode file.<br>
<br>
What is the reason for this behavior?<br>
</blockquote>
<br></div>
my guess: if the LTO optimizers crash, this is very helpful for debugging<br>
because it gives you the input to the optimizers.<br></blockquote><div><br></div><div style>This is true. It also means that if the LTO optimizers don't crash, the bitcode is out of sync with the program. And not crashing is more common than crashing ;)</div>

<div style><br></div><div style>The question is whether also-emit-llvm is an option intended for LTO debuggers or for LLVM end-users. I'd argue that it is very useful for end-users, and that LTO developers could get the bitcode through other means if they are researching a crash. At least from my personal point of view, I use also-emit-llvm frequently despite not working on LTO. How do other people use this?</div>

<div style><br></div><div style>Best,</div><div style>Jonas</div></div></div></div>