<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 25, 2015 at 9:49 PM, 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 id=":ch6" class="a3s" style="overflow:hidden">Hi hfinkel,<br>
<br>
When jump threading this code<br>
<br>
%B = phi i32 [%v1, %T1], [12, %F1]<br>
%A = icmp ne i32 %B, 42<br>
<br>
in asserts builds its common to have an expect in between:<br>
<br>
%B = phi i64 [%v1, %T1], [12, %F1]<br>
%expect = call i64 @llvm.expect.i64(i64 %B, i64 42)<br>
%A = icmp ne i64 %expect, 42<br>
<br>
This patch teaches JumpThreading about this case so that when we fail to find a PHI, we look through an llvm.expect to see if a PHI is its first source.<br>
<br>
Reduces the size of an LTO'd llc by almost 2.5%.</div></blockquote></div><br>As with the other patch, how is this happening? The design of expect was specifically to have it completely removed in an early pass to avoid having to teach the rest of the optimizer about it.</div></div>