<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Adding Maxim<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Apr 9, 2018, at 10:06 AM, Sam Parker via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div id="divtagdefaultwrapper" dir="ltr" style="caret-color: rgb(0, 0, 0); font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif;" class="">
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div class="">Hi,<br class="">
<br class="">
extractRangeChecksFromBranch uses BranchProbabilityInfo to decide whether its worth trying the InductiveRangeCheckElimination transformation. For the following example:<br class="">
<br class="">
void split() {<br class="">
  for (int i = 0; i < 100; ++i) {<br class="">
    if (i < 99)<br class="">
      do_something()<br class="">
    else<br class="">
      do_something_else()<br class="">
  }<br class="">
}<br class="">
<br class="">
But the reported BPI is reported as 50/50 to whether do_something will be called, but we can see with our human eyes that this should be 99%.<br class="">
<br class="">
So two questions:<br class="">
- why is BPI used to enable the transformation?<br class="">
- would it not be more useful for BPI to use something like inductive range analyis to calculate the probability? And if so, what else could make use of it? To me, InductiveRangeCheckElimination feels like it should be separated out into an analysis and the
 transformation.<br class="">
- or have I misunderstood how and what BPI does?<br class="">
<br class="">
Thanks,<br class="">
sam<br class="">
</div>
<br class="">
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div id="Signature" class="">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" class="">
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: "Times New Roman";" class="">
<span style="font-family: Calibri, Helvetica, sans-serif;" class="">Sam Parker</span></div>
<span style="font-family: Calibri, Helvetica, sans-serif;" class=""></span>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: "Times New Roman";" class="">
<span style="font-family: Calibri, Helvetica, sans-serif;" class="">Compilation Tools Engineer | Arm</span></div>
<span style="font-family: Calibri, Helvetica, sans-serif;" class=""></span>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: "Times New Roman";" class="">
<span style="font-family: Calibri, Helvetica, sans-serif;" class="">. . . . . . . . . . . . . . . . . . . . . . . . . . .</span></div>
<span style="font-family: Calibri, Helvetica, sans-serif;" class=""></span>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: "Times New Roman";" class="">
<span style="font-family: Calibri, Helvetica, sans-serif;" class=""><a href="http://arm.com/" class="">Arm.com</a></span></div>
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
</div>
</div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">IMPORTANT
 NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or
 store or copy the information in any medium. Thank you. _______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">LLVM
 Developers mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="mailto:llvm-dev@lists.llvm.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">llvm-dev@lists.llvm.org</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></div>
</blockquote>
</div>
<br class="">
</body>
</html>