<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 26, 2015 at 11:29 AM, Pete Cooper <span dir="ltr"><<a href="mailto:peter_cooper@apple.com" target="_blank">peter_cooper@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>That would be nice.  I expect (ha!) that we’d do this in IRGen.  I might look in to this, although i’m not too familiar with clang.</div><div><br></div><div>If you’re interested, i’ve worked out why I see this benefit at all in this patch.  I LTO my Debug LLVM.  This results in -O0 on the bitcode produced by LLVM, but then the linker LTO’s with optimizations enabled.  And because LTO doesn’t have LowerExpect in its pipeline, I see many cases of 'call i64 @llvm.expect.i64(i64 1, i64 1)’ in my IR.</div><div><br></div><div>So, getting the front-end to generate metadata would certainly fix this.  As would calling LowerExpect in libLTO or in populateFunctionPassManager even when on -O0.  Or we could just say that a Debug LTO build should live with this issue, although I’d prefer one of the other options to this one.</div></blockquote></div><br>First problem: why are we generating these at -O0 at all? We should just turn that part of Clang off.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Second problem: ... nope, no second problem. ;]</div></div>