<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Chris,<div><br></div><div>Right now clang creates "expect" intrinsic for every __builtin_expect instruction. These intrinsics must be lowered early because in other case they can harm other optimizations. During the lowering we also create "branch_weight" metadata, which can be used by other optimizations using BranchProbability analysis.</div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>-Kuba</div></span>
</div>
<br><div><div>On Jul 6, 2011, at 5:31 PM, Chris Lattner wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On Jul 6, 2011, at 11:22 AM, Jakub Staszak wrote:<br><br><blockquote type="cite">Author: kuba<br></blockquote><blockquote type="cite">Date: Wed Jul  6 13:22:43 2011<br></blockquote><blockquote type="cite">New Revision: 134516<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=134516&view=rev">http://llvm.org/viewvc/llvm-project?rev=134516&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Introduce "expect" intrinsic instructions.<br></blockquote><blockquote type="cite"><br></blockquote><br>Hi Kuba,<br><br>Why is this introducing a new pass to do lowering?<br><br>-Chris<br></div></blockquote></div><br></div></body></html>