<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">Hi David, Gerolf, Mikail,</div>
<div class=""><br class="">
</div>
<div class="">Sorry I’m late to this thread; thanks for bringing my attention to this.</div>
<div class=""><br class="">
</div>
<div class="">The change itself did gain consensus that it was a good change, in so far as it removed some fairly obvious brokenness. I benchmarked the change fairly heavily, but as it affects the inlining heuristics I did expect quite some fallout. The datapoints
 you pointed to are very useful.</div>
<div class=""><br class="">
</div>
<div class="">The intent was always to follow up with a change to the thresholds; in particular to the -Oz threshold, which is currently 25 and should be around zero. I must say that I expected the impact on -Os and -O3 to be much lower - certainly at -O3 I
 expected almost no impact except for highly repetitive (such as auto generated) code, as the inline threshold is 225. Your data shows that isn’t the case, which is news to me!</div>
<div class=""><br class="">
</div>
<div class="">It’s clear from the LNT data that we’re doing more inlining, even at -O3, than we were before. Unfortunately it doesn’t look like that extra inlining is actually improving performance, at least on the x86 numbers (the arm64 numbers didn’t have
 performance data available)!</div>
<div class=""><br class="">
</div>
<div class="">Annoyingly, it’s very difficult for me to a-priori test my proposed threshold changes on all the architectures people care about, so I have two suggestions on how to move forward:</div>
<div class="">  1) I back out this change, merge it with a threshold update and ask people to test it if possible., OR</div>
<div class="">  2) I submit a proposed threshold change for review, submit it when accepted and monitor green dragon to see if the changes bring things back in line. If not, I’ll need to back out both and start from scratch.</div>
<div class=""><br class="">
</div>
<div class="">Do you (Gerolf, David?) have suggestions on a preferred route forward?</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class=""><br class="">
</div>
<div class="">James</div>
<div class=""><br class="">
</div>
<div>
<blockquote type="cite" class="">
<div class="">On 16 Nov 2016, at 07:19, Xinliang David Li <<a href="mailto:xinliangli@gmail.com" class="">xinliangli@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class=""><br class="Apple-interchange-newline">
<br 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-stroke-width: 0px;" class="">
<div class="gmail_quote" 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-stroke-width: 0px;">
On Tue, Nov 15, 2016 at 7:01 PM, Gerolf Hoflehner via llvm-commits<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class="">
<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;">
<div style="word-wrap: break-word;" class="">The compiler should certainly inline the test case, but there seems to be a high compile-time/code size cost on average for Os/O2. It would be great to have a clearer picture of the performance gains for the costs.
 I also hope to get a few eyes on the code review from inliner experts. It is not clear to me that the fix is the correct solution to the problem: 
<div class=""><br class="">
</div>
<div class="">There are 3 uses of call penalty after this commit: when the call cost is estimated it is added, but for the benefits instr cost + call penalty is subtracted. Shouldn’t it be one of instr cost, call penalty or instr cost + call penalty in both
 cases?</div>
</div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">In call cost computation, Instrcost is also added. See analyzeBlock at the callsite where instruction visitor is invoked: if it is not simplified, the cost is added.</div>
<div class=""><br class="">
</div>
<div class="">David </div>
<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;">
<div style="word-wrap: break-word;" class="">
<div class=""><br class="">
</div>
<div class="">This is all about raising awareness.  if the consensus is this is this fix is right thing to do cost is just something to be aware of and move on. </div>
<div class=""><br class="">
</div>
<div class="">Thanks</div>
<div class="">Gerolf</div>
<div class=""><br class="">
</div>
<div class="">PS (more out of curiosity):</div>
<div class=""><br class="">
</div>
<div class="">Also, and this is somewhat orthogonal to the specific change, but I noticed the use of CallPenalty in the following case:</div>
<div class=""><br class="">
</div>
<div class="">
<table cellspacing="0" cellpadding="0" style="width: 1156px; margin: 0px; border: none; font-family: sans-serif;" class="">
<tbody class="">
<tr class="m_2367243965722022965vc_row_odd" id="m_2367243965722022965l1115" style="vertical-align: top; background-color: rgb(240, 240, 240);">
<td class="m_2367243965722022965vc_file_line_text" style="vertical-align: top; border-right-width: 0px; background-color: white; font-family: monospace; white-space: pre-wrap; width: 1099.40625px; border-right-style: solid; border-right-color: rgb(80, 80, 80); padding: 1px 5px;">
<span class="m_2367243965722022965pygments-k" style="color: rgb(0, 128, 0); font-weight: bold;">if</span>
<span class="m_2367243965722022965pygments-p">(</span><span class="m_2367243965722022965pygments-n">TTI</span><span class="m_2367243965722022965pygments-p">.</span><span class="m_2367243965722022965pygments-n">getFPOpCost</span><span class="m_2367243965722022965pygments-p">(</span><span class="m_2367243965722022965pygments-n">I</span><span class="m_2367243965722022965pygments-o" style="color: rgb(102, 102, 102);">-></span><span class="m_2367243965722022965pygments-n">getType</span><span class="m_2367243965722022965pygments-p">())</span>
<span class="m_2367243965722022965pygments-o" style="color: rgb(102, 102, 102);">
==</span> <span class="m_2367243965722022965pygments-n">TargetTransformInfo</span><span class="m_2367243965722022965pygments-o" style="color: rgb(102, 102, 102);">::</span><span class="m_2367243965722022965pygments-n">TCC_<wbr class="">Expensive</span>
<span class="m_2367243965722022965pygments-o" style="color: rgb(102, 102, 102);">
|| <span class="m_2367243965722022965pygments-n" style="">hasSoftFloatAttr</span><span class="m_2367243965722022965pygments-p" style="">)</span>
</span><span class="m_2367243965722022965Apple-tab-span" style="white-space: pre-wrap;"></span><span class="m_2367243965722022965pygments-n">Cost</span>
<span class="m_2367243965722022965pygments-o" style="color: rgb(102, 102, 102);">
+=</span> <span class="m_2367243965722022965pygments-n">InlineConstants</span><span class="m_2367243965722022965pygments-o" style="color: rgb(102, 102, 102);">::</span><span class="m_2367243965722022965pygments-n">CallPenalty</span><span class="m_2367243965722022965pygments-p">;
</span>Why is CallPenalty a good cost estimate under this condition?</td>
</tr>
</tbody>
</table>
<div class="">
<div class="h5">
<div class="">
<blockquote type="cite" class="">
<div class="">On Nov 14, 2016, at 5:48 PM, Mikhail Zolotukhin <<a href="mailto:mzolotukhin@apple.com" target="_blank" class="">mzolotukhin@apple.com</a>> wrote:</div>
<br class="m_2367243965722022965Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word;" class="">Hi James,
<div class=""><br class="">
</div>
<div class="">Green dragon detected some big regressions, most probably from your change (up to 30% code size and compile time regressions on ARM64 [1] and x86 [2]). Did you plan to tweak the thresholds after the change?</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class="">Michael</div>
<div class=""><br class="">
</div>
<div class="">[1] ARM64, Os:<span class="m_2367243965722022965Apple-tab-span" style="white-space: pre-wrap;">
</span><a href="http://104.154.54.203/db_default/v4/nts/13248" target="_blank" class="">http://104.154.54.203/db_<wbr class="">default/v4/nts/13248</a></div>
<div class="">[2] x86, O3+flto:<span class="m_2367243965722022965Apple-tab-span" style="white-space: pre-wrap;">
</span><a href="http://104.154.54.203/db_default/v4/nts/13245" target="_blank" class="">http://104.154.54.203/db_<wbr class="">default/v4/nts/13245</a></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On Nov 14, 2016, at 3:14 AM, James Molloy via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>> wrote:</div>
<br class="m_2367243965722022965Apple-interchange-newline">
<div class="">
<div class="">Author: jamesm<br class="">
Date: Mon Nov 14 05:14:41 2016<br class="">
New Revision: 286814<br class="">
<br class="">
URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=286814&view=rev" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project?rev=286814&view=rev</a><br class="">
Log:<br class="">
[InlineCost] Remove skew when calculating call costs<br class="">
<br class="">
When calculating the cost of a call instruction we were applying a heuristic penalty as well as the cost of the instruction itself.<br class="">
<br class="">
However, when calculating the benefit from inlining we weren't discounting the equivalent penalty for the call instruction that would be removed! This caused skew in the calculation and meant we wouldn't inline in the following, trivial case:<br class="">
<br class="">
 int g() {<br class="">
   h();<br class="">
 }<br class="">
 int f() {<br class="">
   g();<br class="">
 }<br class="">
<br class="">
Modified:<br class="">
   llvm/trunk/lib/Analysis/<wbr class="">InlineCost.cpp<br class="">
   llvm/trunk/test/Transforms/<wbr class="">Inline/alloca-bonus.ll<br class="">
   llvm/trunk/test/Transforms/<wbr class="">Inline/inline-cold-callee.ll<br class="">
   llvm/trunk/test/Transforms/<wbr class="">Inline/inline-cold.ll<br class="">
   llvm/trunk/test/Transforms/<wbr class="">Inline/inline-hot-callee.ll<br class="">
   llvm/trunk/test/Transforms/<wbr class="">Inline/inline-hot-callsite.ll<br class="">
   llvm/trunk/test/Transforms/<wbr class="">Inline/inline-optsize.ll<br class="">
   llvm/trunk/test/Transforms/<wbr class="">Inline/inline_unreachable-2.ll<br class="">
   llvm/trunk/test/Transforms/<wbr class="">Inline/optimization-remarks-<wbr class="">passed-yaml.ll<br class="">
   llvm/trunk/test/Transforms/<wbr class="">Inline/ptr-diff.ll<br class="">
<br class="">
Modified: llvm/trunk/lib/Analysis/<wbr class="">InlineCost.cpp<br class="">
URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InlineCost.cpp?rev=286814&r1=286813&r2=286814&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/llvm/trunk/lib/<wbr class="">Analysis/InlineCost.cpp?rev=<wbr class="">286814&r1=286813&r2=286814&<wbr class="">view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/lib/Analysis/<wbr class="">InlineCost.cpp (original)<br class="">
+++ llvm/trunk/lib/Analysis/<wbr class="">InlineCost.cpp Mon Nov 14 05:14:41 2016<br class="">
@@ -1255,7 +1255,9 @@ bool CallAnalyzer::analyzeCall(<wbr class="">CallSite<br class="">
      Cost -= InlineConstants::InstrCost;<br class="">
    }<br class="">
  }<br class="">
-<br class="">
+  // The call instruction also disappears after inlining.<br class="">
+  Cost -= InlineConstants::InstrCost + InlineConstants::CallPenalty;<br class="">
+  <br class="">
  // If there is only one call of the function, and it has internal linkage,<br class="">
  // the cost of inlining it drops dramatically.<br class="">
  bool OnlyOneCallAndLocalLinkage =<br class="">
<br class="">
Modified: llvm/trunk/test/Transforms/<wbr class="">Inline/alloca-bonus.ll<br class="">
URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/alloca-bonus.ll?rev=286814&r1=286813&r2=286814&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/llvm/trunk/test/<wbr class="">Transforms/Inline/alloca-<wbr class="">bonus.ll?rev=286814&r1=286813&<wbr class="">r2=286814&view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/test/Transforms/<wbr class="">Inline/alloca-bonus.ll (original)<br class="">
+++ llvm/trunk/test/Transforms/<wbr class="">Inline/alloca-bonus.ll Mon Nov 14 05:14:41 2016<br class="">
@@ -22,6 +22,7 @@ define void @inner1(i32 *%ptr) {<br class="">
  %E = bitcast i32* %ptr to i8*<br class="">
  %F = select i1 false, i32* %ptr, i32* @glbl<br class="">
  call void @llvm.lifetime.start(i64 0, i8* %E)<br class="">
+  call void @extern()<br class="">
  ret void<br class="">
}<br class="">
<br class="">
@@ -42,6 +43,7 @@ define void @inner2(i32 *%ptr) {<br class="">
  %E = bitcast i32* %ptr to i8*<br class="">
  %F = select i1 false, i32* %ptr, i32* @glbl<br class="">
  call void @llvm.lifetime.start(i64 0, i8* %E)<br class="">
+  call void @extern()<br class="">
  ret void<br class="">
}<br class="">
<br class="">
@@ -56,6 +58,7 @@ define void @outer3() {<br class="">
define void @inner3(i32 *%ptr, i1 %x) {<br class="">
  %A = icmp eq i32* %ptr, null<br class="">
  %B = and i1 %x, %A<br class="">
+  call void @extern()<br class="">
  br i1 %A, label %bb.true, label %bb.false<br class="">
bb.true:<br class="">
  ; This block musn't be counted in the inline cost.<br class="">
@@ -97,6 +100,7 @@ define void @outer4(i32 %A) {<br class="">
define void @inner4(i32 *%ptr, i32 %A) {<br class="">
  %B = getelementptr inbounds i32, i32* %ptr, i32 %A<br class="">
  %C = icmp eq i32* %ptr, null<br class="">
+  call void @extern()<br class="">
  br i1 %C, label %bb.true, label %bb.false<br class="">
bb.true:<br class="">
  ; This block musn't be counted in the inline cost.<br class="">
@@ -139,6 +143,7 @@ define void @outer5() {<br class="">
define void @inner5(i1 %flag, i32 *%ptr) {<br class="">
  %A = load i32, i32* %ptr<br class="">
  store i32 0, i32* %ptr<br class="">
+  call void @extern()<br class="">
  %C = getelementptr inbounds i32, i32* %ptr, i32 0<br class="">
  br i1 %flag, label %if.then, label %exit<br class="">
<br class="">
@@ -153,3 +158,4 @@ exit:<br class="">
  ret void<br class="">
}<br class="">
<br class="">
+declare void @extern()<br class="">
<br class="">
Modified: llvm/trunk/test/Transforms/<wbr class="">Inline/inline-cold-callee.ll<br class="">
URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/inline-cold-callee.ll?rev=286814&r1=286813&r2=286814&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/llvm/trunk/test/<wbr class="">Transforms/Inline/inline-cold-<wbr class="">callee.ll?rev=286814&r1=<wbr class="">286813&r2=286814&view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/test/Transforms/<wbr class="">Inline/inline-cold-callee.ll (original)<br class="">
+++ llvm/trunk/test/Transforms/<wbr class="">Inline/inline-cold-callee.ll Mon Nov 14 05:14:41 2016<br class="">
@@ -9,7 +9,7 @@ define i32 @callee1(i32 %x) !prof !21 {<br class="">
  %x1 = add i32 %x, 1<br class="">
  %x2 = add i32 %x1, 1<br class="">
  %x3 = add i32 %x2, 1<br class="">
-<br class="">
+  call void @extern()<br class="">
  ret i32 %x3<br class="">
}<br class="">
<br class="">
@@ -18,7 +18,7 @@ define i32 @callee2(i32 %x) !prof !22 {<br class="">
  %x1 = add i32 %x, 1<br class="">
  %x2 = add i32 %x1, 1<br class="">
  %x3 = add i32 %x2, 1<br class="">
-<br class="">
+  call void @extern()<br class="">
  ret i32 %x3<br class="">
}<br class="">
<br class="">
@@ -32,6 +32,8 @@ define i32 @caller2(i32 %y1) !prof !22 {<br class="">
  ret i32 %y3<br class="">
}<br class="">
<br class="">
+declare void @extern()<br class="">
+<br class="">
!llvm.module.flags = !{!1}<br class="">
!21 = !{!"function_entry_count", i64 100}<br class="">
!22 = !{!"function_entry_count", i64 1}<br class="">
<br class="">
Modified: llvm/trunk/test/Transforms/<wbr class="">Inline/inline-cold.ll<br class="">
URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/inline-cold.ll?rev=286814&r1=286813&r2=286814&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/llvm/trunk/test/<wbr class="">Transforms/Inline/inline-cold.<wbr class="">ll?rev=286814&r1=286813&r2=<wbr class="">286814&view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/test/Transforms/<wbr class="">Inline/inline-cold.ll (original)<br class="">
+++ llvm/trunk/test/Transforms/<wbr class="">Inline/inline-cold.ll Mon Nov 14 05:14:41 2016<br class="">
@@ -17,6 +17,7 @@<br class="">
; Function Attrs: nounwind readnone uwtable<br class="">
define i32 @simpleFunction(i32 %a) #0 {<br class="">
entry:<br class="">
+  call void @extern()<br class="">
  %a1 = load volatile i32, i32* @a<br class="">
  %x1 = add i32 %a1,  %a1<br class="">
  %a2 = load volatile i32, i32* @a<br class="">
@@ -54,6 +55,7 @@ define i32 @ColdFunction(i32 %a) #1 {<br class="">
; DEFAULT-LABEL: @ColdFunction<br class="">
; DEFAULT: ret<br class="">
entry:<br class="">
+  call void @extern()<br class="">
  %a1 = load volatile i32, i32* @a<br class="">
  %x1 = add i32 %a1,  %a1<br class="">
  %a2 = load volatile i32, i32* @a<br class="">
@@ -91,6 +93,7 @@ define i32 @ColdFunction2(i32 %a) #1 {<br class="">
; DEFAULT-LABEL: @ColdFunction2<br class="">
; DEFAULT: ret<br class="">
entry:<br class="">
+  call void @extern()<br class="">
  %a1 = load volatile i32, i32* @a<br class="">
  %x1 = add i32 %a1,  %a1<br class="">
  %a2 = load volatile i32, i32* @a<br class="">
@@ -196,5 +199,6 @@ entry:<br class="">
  ret i32 %add<br class="">
}<br class="">
<br class="">
+declare void @extern()<br class="">
attributes #0 = { nounwind readnone uwtable }<br class="">
attributes #1 = { nounwind cold readnone uwtable }<br class="">
<br class="">
Modified: llvm/trunk/test/Transforms/<wbr class="">Inline/inline-hot-callee.ll<br class="">
URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/inline-hot-callee.ll?rev=286814&r1=286813&r2=286814&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/llvm/trunk/test/<wbr class="">Transforms/Inline/inline-hot-<wbr class="">callee.ll?rev=286814&r1=<wbr class="">286813&r2=286814&view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/test/Transforms/<wbr class="">Inline/inline-hot-callee.ll (original)<br class="">
+++ llvm/trunk/test/Transforms/<wbr class="">Inline/inline-hot-callee.ll Mon Nov 14 05:14:41 2016<br class="">
@@ -9,7 +9,7 @@ define i32 @callee1(i32 %x) !prof !21 {<br class="">
  %x1 = add i32 %x, 1<br class="">
  %x2 = add i32 %x1, 1<br class="">
  %x3 = add i32 %x2, 1<br class="">
-<br class="">
+  call void @extern()<br class="">
  ret i32 %x3<br class="">
}<br class="">
<br class="">
@@ -18,7 +18,7 @@ define i32 @callee2(i32 %x) !prof !22 {<br class="">
  %x1 = add i32 %x, 1<br class="">
  %x2 = add i32 %x1, 1<br class="">
  %x3 = add i32 %x2, 1<br class="">
-<br class="">
+  call void @extern()<br class="">
  ret i32 %x3<br class="">
}<br class="">
<br class="">
@@ -32,6 +32,8 @@ define i32 @caller2(i32 %y1) !prof !22 {<br class="">
  ret i32 %y3<br class="">
}<br class="">
<br class="">
+declare void @extern()<br class="">
+<br class="">
!llvm.module.flags = !{!1}<br class="">
!21 = !{!"function_entry_count", i64 300}<br class="">
!22 = !{!"function_entry_count", i64 1}<br class="">
<br class="">
Modified: llvm/trunk/test/Transforms/<wbr class="">Inline/inline-hot-callsite.ll<br class="">
URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/inline-hot-callsite.ll?rev=286814&r1=286813&r2=286814&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/llvm/trunk/test/<wbr class="">Transforms/Inline/inline-hot-<wbr class="">callsite.ll?rev=286814&r1=<wbr class="">286813&r2=286814&view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/test/Transforms/<wbr class="">Inline/inline-hot-callsite.ll (original)<br class="">
+++ llvm/trunk/test/Transforms/<wbr class="">Inline/inline-hot-callsite.ll Mon Nov 14 05:14:41 2016<br class="">
@@ -9,7 +9,7 @@ define i32 @callee1(i32 %x) {<br class="">
  %x1 = add i32 %x, 1<br class="">
  %x2 = add i32 %x1, 1<br class="">
  %x3 = add i32 %x2, 1<br class="">
-<br class="">
+  call void @extern()<br class="">
  ret i32 %x3<br class="">
}<br class="">
<br class="">
@@ -18,7 +18,7 @@ define i32 @callee2(i32 %x) {<br class="">
  %x1 = add i32 %x, 1<br class="">
  %x2 = add i32 %x1, 1<br class="">
  %x3 = add i32 %x2, 1<br class="">
-<br class="">
+  call void @extern()<br class="">
  ret i32 %x3<br class="">
}<br class="">
<br class="">
@@ -32,6 +32,8 @@ define i32 @caller2(i32 %y1) {<br class="">
  ret i32 %y3<br class="">
}<br class="">
<br class="">
+declare void @extern()<br class="">
+<br class="">
!llvm.module.flags = !{!1}<br class="">
!21 = !{!"branch_weights", i64 300}<br class="">
!22 = !{!"branch_weights", i64 1}<br class="">
<br class="">
Modified: llvm/trunk/test/Transforms/<wbr class="">Inline/inline-optsize.ll<br class="">
URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/inline-optsize.ll?rev=286814&r1=286813&r2=286814&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/llvm/trunk/test/<wbr class="">Transforms/Inline/inline-<wbr class="">optsize.ll?rev=286814&r1=<wbr class="">286813&r2=286814&view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/test/Transforms/<wbr class="">Inline/inline-optsize.ll (original)<br class="">
+++ llvm/trunk/test/Transforms/<wbr class="">Inline/inline-optsize.ll Mon Nov 14 05:14:41 2016<br class="">
@@ -12,6 +12,7 @@<br class="">
; This function should be larger than the inline threshold for -Oz (25), but<br class="">
; smaller than the inline threshold for optsize (75).<br class="">
define i32 @inner() {<br class="">
+  call void @extern()<br class="">
  %a1 = load volatile i32, i32* @a<br class="">
  %x1 = add i32 %a1,  %a1<br class="">
  %a2 = load volatile i32, i32* @a<br class="">
@@ -42,3 +43,5 @@ define i32 @outer2() minsize {<br class="">
   %r = call i32 @inner()<br class="">
   ret i32 %r<br class="">
}<br class="">
+<br class="">
+declare void @extern()<br class="">
\ No newline at end of file<br class="">
<br class="">
Modified: llvm/trunk/test/Transforms/<wbr class="">Inline/inline_unreachable-2.ll<br class="">
URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/inline_unreachable-2.ll?rev=286814&r1=286813&r2=286814&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/llvm/trunk/test/<wbr class="">Transforms/Inline/inline_<wbr class="">unreachable-2.ll?rev=286814&<wbr class="">r1=286813&r2=286814&view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/test/Transforms/<wbr class="">Inline/inline_unreachable-2.ll (original)<br class="">
+++ llvm/trunk/test/Transforms/<wbr class="">Inline/inline_unreachable-2.ll Mon Nov 14 05:14:41 2016<br class="">
@@ -8,6 +8,7 @@ define void @caller(i32 %a, i1 %b) #0 {<br class="">
}<br class="">
<br class="">
define void @callee(i32 %a, i1 %b) {<br class="">
+  call void @extern()<br class="">
  call void asm sideeffect "", ""()<br class="">
  br i1 %b, label %bb1, label %bb2<br class="">
bb1:<br class="">
@@ -17,3 +18,5 @@ bb2:<br class="">
  call void asm sideeffect "", ""()<br class="">
  ret void<br class="">
}<br class="">
+<br class="">
+declare void @extern()<br class="">
\ No newline at end of file<br class="">
<br class="">
Modified: llvm/trunk/test/Transforms/<wbr class="">Inline/optimization-remarks-<wbr class="">passed-yaml.ll<br class="">
URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/optimization-remarks-passed-yaml.ll?rev=286814&r1=286813&r2=286814&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/llvm/trunk/test/<wbr class="">Transforms/Inline/<wbr class="">optimization-remarks-passed-<wbr class="">yaml.ll?rev=286814&r1=286813&<wbr class="">r2=286814&view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/test/Transforms/<wbr class="">Inline/optimization-remarks-<wbr class="">passed-yaml.ll (original)<br class="">
+++ llvm/trunk/test/Transforms/<wbr class="">Inline/optimization-remarks-<wbr class="">passed-yaml.ll Mon Nov 14 05:14:41 2016<br class="">
@@ -12,7 +12,7 @@<br class="">
;  4       return foo();<br class="">
;  5     }<br class="">
<br class="">
-; CHECK:      remark: /tmp/s.c:4:10: foo can be inlined into bar with cost={{[0-9]+}} (threshold={{[0-9]+}}) (hotness: 30)<br class="">
+; CHECK:      remark: /tmp/s.c:4:10: foo can be inlined into bar with cost={{[0-9\-]+}} (threshold={{[0-9]+}}) (hotness: 30)<br class="">
; CHECK-NEXT: remark: /tmp/s.c:4:10: foo inlined into bar (hotness: 30)<br class="">
<br class="">
; YAML:      --- !Analysis<br class="">
@@ -28,7 +28,7 @@<br class="">
; YAML-NEXT:   - Caller: bar<br class="">
; YAML-NEXT:     DebugLoc:        { File: /tmp/s.c, Line: 3, Column: 0 }<br class="">
; YAML-NEXT:   - String: ' with cost='<br class="">
-; YAML-NEXT:   - Cost: '{{[0-9]+}}'<br class="">
+; YAML-NEXT:   - Cost: '{{[0-9\-]+}}'<br class="">
; YAML-NEXT:   - String: ' (threshold='<br class="">
; YAML-NEXT:   - Threshold: '{{[0-9]+}}'<br class="">
; YAML-NEXT:   - String: ')'<br class="">
<br class="">
Modified: llvm/trunk/test/Transforms/<wbr class="">Inline/ptr-diff.ll<br class="">
URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/ptr-diff.ll?rev=286814&r1=286813&r2=286814&view=diff" target="_blank" class="">http://llvm.org/viewvc/llvm-<wbr class="">project/llvm/trunk/test/<wbr class="">Transforms/Inline/ptr-diff.ll?<wbr class="">rev=286814&r1=286813&r2=<wbr class="">286814&view=diff</a><br class="">
==============================<wbr class="">==============================<wbr class="">==================<br class="">
--- llvm/trunk/test/Transforms/<wbr class="">Inline/ptr-diff.ll (original)<br class="">
+++ llvm/trunk/test/Transforms/<wbr class="">Inline/ptr-diff.ll Mon Nov 14 05:14:41 2016<br class="">
@@ -4,7 +4,7 @@ target datalayout = "p:32:32-p1:64:64-p2<br class="">
<br class="">
define i32 @outer1() {<br class="">
; CHECK-LABEL: @outer1(<br class="">
-; CHECK-NOT: call<br class="">
+; CHECK-NOT: call i32<br class="">
; CHECK: ret i32<br class="">
<br class="">
  %ptr = alloca i32<br class="">
@@ -15,6 +15,7 @@ define i32 @outer1() {<br class="">
}<br class="">
<br class="">
define i32 @inner1(i32* %begin, i32* %end) {<br class="">
+  call void @extern()<br class="">
  %begin.i = ptrtoint i32* %begin to i32<br class="">
  %end.i = ptrtoint i32* %end to i32<br class="">
  %distance = sub i32 %end.i, %begin.i<br class="">
@@ -43,6 +44,7 @@ define i32 @outer2(i32* %ptr) {<br class="">
}<br class="">
<br class="">
define i32 @inner2(i32* %begin, i32* %end) {<br class="">
+  call void @extern()<br class="">
  %begin.i = ptrtoint i32* %begin to i32<br class="">
  %end.i = ptrtoint i32* %end to i32<br class="">
  %distance = sub i32 %end.i, %begin.i<br class="">
@@ -60,6 +62,7 @@ else:<br class="">
; The inttoptrs are free since it is a smaller integer to a larger<br class="">
; pointer size<br class="">
define i32 @inttoptr_free_cost(i32 %a, i32 %b, i32 %c) {<br class="">
+  call void @extern()<br class="">
  %p1 = inttoptr i32 %a to i32 addrspace(1)*<br class="">
  %p2 = inttoptr i32 %b to i32 addrspace(1)*<br class="">
  %p3 = inttoptr i32 %c to i32 addrspace(1)*<br class="">
@@ -73,7 +76,7 @@ define i32 @inttoptr_free_cost(i32 %a, i<br class="">
<br class="">
define i32 @inttoptr_free_cost_user(i32 %begin, i32 %end) {<br class="">
; CHECK-LABEL: @inttoptr_free_cost_user(<br class="">
-; CHECK-NOT: call<br class="">
+; CHECK-NOT: call i32<br class="">
  %x = call i32 @inttoptr_free_cost(i32 %begin, i32 %end, i32 9)<br class="">
  ret i32 %x<br class="">
}<br class="">
@@ -81,6 +84,7 @@ define i32 @inttoptr_free_cost_user(i32<br class="">
; The inttoptrs have a cost since it is a larger integer to a smaller<br class="">
; pointer size<br class="">
define i32 @inttoptr_cost_smaller_ptr(i32 %a, i32 %b, i32 %c) {<br class="">
+  call void @extern()<br class="">
  %p1 = inttoptr i32 %a to i32 addrspace(2)*<br class="">
  %p2 = inttoptr i32 %b to i32 addrspace(2)*<br class="">
  %p3 = inttoptr i32 %c to i32 addrspace(2)*<br class="">
@@ -94,8 +98,9 @@ define i32 @inttoptr_cost_smaller_ptr(i3<br class="">
<br class="">
define i32 @inttoptr_cost_smaller_ptr_<wbr class="">user(i32 %begin, i32 %end) {<br class="">
; CHECK-LABEL: @inttoptr_cost_smaller_ptr_<wbr class="">user(<br class="">
-; CHECK: call<br class="">
+; CHECK: call i32<br class="">
  %x = call i32 @inttoptr_cost_smaller_ptr(i32 %begin, i32 %end, i32 9)<br class="">
  ret i32 %x<br class="">
}<br class="">
<br class="">
+declare void @extern()<br class="">
\ No newline at end of file<br class="">
<br class="">
<br class="">
______________________________<wbr class="">_________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-commits</a><br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
<br class="">
______________________________<wbr class="">_________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-commits</a></blockquote>
</div>
</div>
</blockquote>
</div>
<br 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.
</body>
</html>