<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 16, 2016 at 3:54 AM, James Molloy <span dir="ltr"><<a href="mailto:James.Molloy@arm.com" target="_blank">James.Molloy@arm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">
<div>Hi David, Gerolf, Mikail,</div>
<div><br>
</div>
<div>Sorry I’m late to this thread; thanks for bringing my attention to this.</div>
<div><br>
</div>
<div>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><br>
</div>
<div>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><br>
</div>
<div>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><br>
</div>
<div>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>  1) I back out this change, merge it with a threshold update and ask people to test it if possible., OR</div>
<div>  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><br>
</div>
<div>Do you (Gerolf, David?) have suggestions on a preferred route forward?</div></div></blockquote><div><br></div><div>Rolling forward seems like a better approach to me.</div><div><br></div><div>David</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>James</div><div><div class="h5">
<div><br>
</div>
<div>
<blockquote type="cite">
<div>On 16 Nov 2016, at 07:19, Xinliang David Li <<a href="mailto:xinliangli@gmail.com" target="_blank">xinliangli@gmail.com</a>> wrote:</div>
<br class="m_2280295795711151765Apple-interchange-newline">
<div><br class="m_2280295795711151765Apple-interchange-newline">
<br style="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">
<div class="gmail_quote" style="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">
On Tue, Nov 15, 2016 at 7:01 PM, Gerolf Hoflehner via llvm-commits<span class="m_2280295795711151765Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@<wbr>lists.llvm.org</a>></span><span class="m_2280295795711151765Apple-converted-space"> </span>wrote:<br>
<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">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><br>
</div>
<div>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><br>
</div>
<div>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><br>
</div>
<div>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">
<div><br>
</div>
<div>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><br>
</div>
<div>Thanks</div>
<div>Gerolf</div>
<div><br>
</div>
<div>PS (more out of curiosity):</div>
<div><br>
</div>
<div>Also, and this is somewhat orthogonal to the specific change, but I noticed the use of CallPenalty in the following case:</div>
<div><br>
</div>
<div>
<table cellspacing="0" cellpadding="0" style="width:1156px;margin:0px;border:none;font-family:sans-serif">
<tbody>
<tr class="m_2280295795711151765m_2367243965722022965vc_row_odd" id="m_2280295795711151765m_2367243965722022965l1115" style="vertical-align:top;background-color:rgb(240,240,240)">
<td class="m_2280295795711151765m_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_2280295795711151765m_2367243965722022965pygments-k" style="color:rgb(0,128,0);font-weight:bold">if</span>
<span class="m_2280295795711151765m_2367243965722022965pygments-p">(</span><span class="m_2280295795711151765m_2367243965722022965pygments-n">TTI</span><span class="m_2280295795711151765m_2367243965722022965pygments-p">.</span><span class="m_2280295795711151765m_2367243965722022965pygments-n">getFPOpCost</span><span class="m_2280295795711151765m_2367243965722022965pygments-p">(</span><span class="m_2280295795711151765m_2367243965722022965pygments-n">I</span><span class="m_2280295795711151765m_2367243965722022965pygments-o" style="color:rgb(102,102,102)">-></span><span class="m_2280295795711151765m_2367243965722022965pygments-n">getType</span><span class="m_2280295795711151765m_2367243965722022965pygments-p">())</span>
<span class="m_2280295795711151765m_2367243965722022965pygments-o" style="color:rgb(102,102,102)">
==</span> <span class="m_2280295795711151765m_2367243965722022965pygments-n">TargetTransformInfo</span><span class="m_2280295795711151765m_2367243965722022965pygments-o" style="color:rgb(102,102,102)">::</span><span class="m_2280295795711151765m_2367243965722022965pygments-n">TCC_Expen<wbr>sive</span>
<span class="m_2280295795711151765m_2367243965722022965pygments-o" style="color:rgb(102,102,102)">
|| <span class="m_2280295795711151765m_2367243965722022965pygments-n">hasSoftFloatAttr</span><span class="m_2280295795711151765m_2367243965722022965pygments-p">)</span>
</span><span class="m_2280295795711151765m_2367243965722022965Apple-tab-span" style="white-space:pre-wrap"></span><span class="m_2280295795711151765m_2367243965722022965pygments-n">Cost</span>
<span class="m_2280295795711151765m_2367243965722022965pygments-o" style="color:rgb(102,102,102)">
+=</span> <span class="m_2280295795711151765m_2367243965722022965pygments-n">InlineConstants</span><span class="m_2280295795711151765m_2367243965722022965pygments-o" style="color:rgb(102,102,102)">::</span><span class="m_2280295795711151765m_2367243965722022965pygments-n">CallPenalty</span><span class="m_2280295795711151765m_2367243965722022965pygments-p">;
</span>Why is CallPenalty a good cost estimate under this condition?</td>
</tr>
</tbody>
</table>
<div>
<div class="m_2280295795711151765h5">
<div>
<blockquote type="cite">
<div>On Nov 14, 2016, at 5:48 PM, Mikhail Zolotukhin <<a href="mailto:mzolotukhin@apple.com" target="_blank">mzolotukhin@apple.com</a>> wrote:</div>
<br class="m_2280295795711151765m_2367243965722022965Apple-interchange-newline">
<div>
<div style="word-wrap:break-word">Hi James,
<div><br>
</div>
<div>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><br>
</div>
<div>Thanks,</div>
<div>Michael</div>
<div><br>
</div>
<div>[1] ARM64, Os:<span class="m_2280295795711151765m_2367243965722022965Apple-tab-span" style="white-space:pre-wrap">
</span><a href="http://104.154.54.203/db_default/v4/nts/13248" target="_blank">http://104.154.54.203/db_defau<wbr>lt/v4/nts/13248</a></div>
<div>[2] x86, O3+flto:<span class="m_2280295795711151765m_2367243965722022965Apple-tab-span" style="white-space:pre-wrap">
</span><a href="http://104.154.54.203/db_default/v4/nts/13245" target="_blank">http://104.154.54.203/db_defau<wbr>lt/v4/nts/13245</a></div>
<div><br>
</div>
<div><br>
<div>
<blockquote type="cite">
<div>On Nov 14, 2016, at 3:14 AM, James Molloy via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:</div>
<br class="m_2280295795711151765m_2367243965722022965Apple-interchange-newline">
<div>
<div>Author: jamesm<br>
Date: Mon Nov 14 05:14:41 2016<br>
New Revision: 286814<br>
<br>
URL:<span class="m_2280295795711151765Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=286814&view=rev" target="_blank">http://llvm.org/viewvc/<wbr>llvm-project?rev=286814&view=<wbr>rev</a><br>
Log:<br>
[InlineCost] Remove skew when calculating call costs<br>
<br>
When calculating the cost of a call instruction we were applying a heuristic penalty as well as the cost of the instruction itself.<br>
<br>
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>
<br>
 int g() {<br>
   h();<br>
 }<br>
 int f() {<br>
   g();<br>
 }<br>
<br>
Modified:<br>
   llvm/trunk/lib/Analysis/Inl<wbr>ineCost.cpp<br>
   llvm/trunk/test/Transforms/<wbr>Inline/alloca-bonus.ll<br>
   llvm/trunk/test/Transforms/<wbr>Inline/inline-cold-callee.ll<br>
   llvm/trunk/test/Transforms/<wbr>Inline/inline-cold.ll<br>
   llvm/trunk/test/Transforms/<wbr>Inline/inline-hot-callee.ll<br>
   llvm/trunk/test/Transforms/<wbr>Inline/inline-hot-callsite.ll<br>
   llvm/trunk/test/Transforms/<wbr>Inline/inline-optsize.ll<br>
   llvm/trunk/test/Transforms/<wbr>Inline/inline_unreachable-2.ll<br>
   llvm/trunk/test/Transforms/<wbr>Inline/optimization-remarks-pa<wbr>ssed-yaml.ll<br>
   llvm/trunk/test/Transforms/<wbr>Inline/ptr-diff.ll<br>
<br>
Modified: llvm/trunk/lib/Analysis/Inline<wbr>Cost.cpp<br>
URL:<span class="m_2280295795711151765Apple-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">http://llvm.org/viewvc/<wbr>llvm-project/llvm/trunk/lib/An<wbr>alysis/InlineCost.cpp?rev=2868<wbr>14&r1=286813&r2=286814&view=<wbr>diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/lib/Analysis/Inline<wbr>Cost.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/Inline<wbr>Cost.cpp Mon Nov 14 05:14:41 2016<br>
@@ -1255,7 +1255,9 @@ bool CallAnalyzer::analyzeCall(Call<wbr>Site<br>
      Cost -= InlineConstants::InstrCost;<br>
    }<br>
  }<br>
-<br>
+  // The call instruction also disappears after inlining.<br>
+  Cost -= InlineConstants::InstrCost + InlineConstants::CallPenalty;<br>
+  <br>
  // If there is only one call of the function, and it has internal linkage,<br>
  // the cost of inlining it drops dramatically.<br>
  bool OnlyOneCallAndLocalLinkage =<br>
<br>
Modified: llvm/trunk/test/Transforms/Inl<wbr>ine/alloca-bonus.ll<br>
URL:<span class="m_2280295795711151765Apple-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">http://llvm.org/viewvc/<wbr>llvm-project/llvm/trunk/test/T<wbr>ransforms/Inline/alloca-bonus.<wbr>ll?rev=286814&r1=286813&r2=<wbr>286814&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Transforms/Inl<wbr>ine/alloca-bonus.ll (original)<br>
+++ llvm/trunk/test/Transforms/Inl<wbr>ine/alloca-bonus.ll Mon Nov 14 05:14:41 2016<br>
@@ -22,6 +22,7 @@ define void @inner1(i32 *%ptr) {<br>
  %E = bitcast i32* %ptr to i8*<br>
  %F = select i1 false, i32* %ptr, i32* @glbl<br>
  call void @llvm.lifetime.start(i64 0, i8* %E)<br>
+  call void @extern()<br>
  ret void<br>
}<br>
<br>
@@ -42,6 +43,7 @@ define void @inner2(i32 *%ptr) {<br>
  %E = bitcast i32* %ptr to i8*<br>
  %F = select i1 false, i32* %ptr, i32* @glbl<br>
  call void @llvm.lifetime.start(i64 0, i8* %E)<br>
+  call void @extern()<br>
  ret void<br>
}<br>
<br>
@@ -56,6 +58,7 @@ define void @outer3() {<br>
define void @inner3(i32 *%ptr, i1 %x) {<br>
  %A = icmp eq i32* %ptr, null<br>
  %B = and i1 %x, %A<br>
+  call void @extern()<br>
  br i1 %A, label %bb.true, label %bb.false<br>
bb.true:<br>
  ; This block musn't be counted in the inline cost.<br>
@@ -97,6 +100,7 @@ define void @outer4(i32 %A) {<br>
define void @inner4(i32 *%ptr, i32 %A) {<br>
  %B = getelementptr inbounds i32, i32* %ptr, i32 %A<br>
  %C = icmp eq i32* %ptr, null<br>
+  call void @extern()<br>
  br i1 %C, label %bb.true, label %bb.false<br>
bb.true:<br>
  ; This block musn't be counted in the inline cost.<br>
@@ -139,6 +143,7 @@ define void @outer5() {<br>
define void @inner5(i1 %flag, i32 *%ptr) {<br>
  %A = load i32, i32* %ptr<br>
  store i32 0, i32* %ptr<br>
+  call void @extern()<br>
  %C = getelementptr inbounds i32, i32* %ptr, i32 0<br>
  br i1 %flag, label %if.then, label %exit<br>
<br>
@@ -153,3 +158,4 @@ exit:<br>
  ret void<br>
}<br>
<br>
+declare void @extern()<br>
<br>
Modified: llvm/trunk/test/Transforms/Inl<wbr>ine/inline-cold-callee.ll<br>
URL:<span class="m_2280295795711151765Apple-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">http://llvm.org/viewvc/<wbr>llvm-project/llvm/trunk/test/T<wbr>ransforms/Inline/inline-cold-c<wbr>allee.ll?rev=286814&r1=286813&<wbr>r2=286814&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Transforms/Inl<wbr>ine/inline-cold-callee.ll (original)<br>
+++ llvm/trunk/test/Transforms/Inl<wbr>ine/inline-cold-callee.ll Mon Nov 14 05:14:41 2016<br>
@@ -9,7 +9,7 @@ define i32 @callee1(i32 %x) !prof !21 {<br>
  %x1 = add i32 %x, 1<br>
  %x2 = add i32 %x1, 1<br>
  %x3 = add i32 %x2, 1<br>
-<br>
+  call void @extern()<br>
  ret i32 %x3<br>
}<br>
<br>
@@ -18,7 +18,7 @@ define i32 @callee2(i32 %x) !prof !22 {<br>
  %x1 = add i32 %x, 1<br>
  %x2 = add i32 %x1, 1<br>
  %x3 = add i32 %x2, 1<br>
-<br>
+  call void @extern()<br>
  ret i32 %x3<br>
}<br>
<br>
@@ -32,6 +32,8 @@ define i32 @caller2(i32 %y1) !prof !22 {<br>
  ret i32 %y3<br>
}<br>
<br>
+declare void @extern()<br>
+<br>
!llvm.module.flags = !{!1}<br>
!21 = !{!"function_entry_count", i64 100}<br>
!22 = !{!"function_entry_count", i64 1}<br>
<br>
Modified: llvm/trunk/test/Transforms/Inl<wbr>ine/inline-cold.ll<br>
URL:<span class="m_2280295795711151765Apple-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">http://llvm.org/viewvc/<wbr>llvm-project/llvm/trunk/test/T<wbr>ransforms/Inline/inline-cold.l<wbr>l?rev=286814&r1=286813&r2=2868<wbr>14&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Transforms/Inl<wbr>ine/inline-cold.ll (original)<br>
+++ llvm/trunk/test/Transforms/Inl<wbr>ine/inline-cold.ll Mon Nov 14 05:14:41 2016<br>
@@ -17,6 +17,7 @@<br>
; Function Attrs: nounwind readnone uwtable<br>
define i32 @simpleFunction(i32 %a) #0 {<br>
entry:<br>
+  call void @extern()<br>
  %a1 = load volatile i32, i32* @a<br>
  %x1 = add i32 %a1,  %a1<br>
  %a2 = load volatile i32, i32* @a<br>
@@ -54,6 +55,7 @@ define i32 @ColdFunction(i32 %a) #1 {<br>
; DEFAULT-LABEL: @ColdFunction<br>
; DEFAULT: ret<br>
entry:<br>
+  call void @extern()<br>
  %a1 = load volatile i32, i32* @a<br>
  %x1 = add i32 %a1,  %a1<br>
  %a2 = load volatile i32, i32* @a<br>
@@ -91,6 +93,7 @@ define i32 @ColdFunction2(i32 %a) #1 {<br>
; DEFAULT-LABEL: @ColdFunction2<br>
; DEFAULT: ret<br>
entry:<br>
+  call void @extern()<br>
  %a1 = load volatile i32, i32* @a<br>
  %x1 = add i32 %a1,  %a1<br>
  %a2 = load volatile i32, i32* @a<br>
@@ -196,5 +199,6 @@ entry:<br>
  ret i32 %add<br>
}<br>
<br>
+declare void @extern()<br>
attributes #0 = { nounwind readnone uwtable }<br>
attributes #1 = { nounwind cold readnone uwtable }<br>
<br>
Modified: llvm/trunk/test/Transforms/Inl<wbr>ine/inline-hot-callee.ll<br>
URL:<span class="m_2280295795711151765Apple-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">http://llvm.org/viewvc/<wbr>llvm-project/llvm/trunk/test/T<wbr>ransforms/Inline/inline-hot-ca<wbr>llee.ll?rev=286814&r1=286813&<wbr>r2=286814&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Transforms/Inl<wbr>ine/inline-hot-callee.ll (original)<br>
+++ llvm/trunk/test/Transforms/Inl<wbr>ine/inline-hot-callee.ll Mon Nov 14 05:14:41 2016<br>
@@ -9,7 +9,7 @@ define i32 @callee1(i32 %x) !prof !21 {<br>
  %x1 = add i32 %x, 1<br>
  %x2 = add i32 %x1, 1<br>
  %x3 = add i32 %x2, 1<br>
-<br>
+  call void @extern()<br>
  ret i32 %x3<br>
}<br>
<br>
@@ -18,7 +18,7 @@ define i32 @callee2(i32 %x) !prof !22 {<br>
  %x1 = add i32 %x, 1<br>
  %x2 = add i32 %x1, 1<br>
  %x3 = add i32 %x2, 1<br>
-<br>
+  call void @extern()<br>
  ret i32 %x3<br>
}<br>
<br>
@@ -32,6 +32,8 @@ define i32 @caller2(i32 %y1) !prof !22 {<br>
  ret i32 %y3<br>
}<br>
<br>
+declare void @extern()<br>
+<br>
!llvm.module.flags = !{!1}<br>
!21 = !{!"function_entry_count", i64 300}<br>
!22 = !{!"function_entry_count", i64 1}<br>
<br>
Modified: llvm/trunk/test/Transforms/Inl<wbr>ine/inline-hot-callsite.ll<br>
URL:<span class="m_2280295795711151765Apple-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">http://llvm.org/viewvc/<wbr>llvm-project/llvm/trunk/test/T<wbr>ransforms/Inline/inline-hot-ca<wbr>llsite.ll?rev=286814&r1=286813<wbr>&r2=286814&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Transforms/Inl<wbr>ine/inline-hot-callsite.ll (original)<br>
+++ llvm/trunk/test/Transforms/Inl<wbr>ine/inline-hot-callsite.ll Mon Nov 14 05:14:41 2016<br>
@@ -9,7 +9,7 @@ define i32 @callee1(i32 %x) {<br>
  %x1 = add i32 %x, 1<br>
  %x2 = add i32 %x1, 1<br>
  %x3 = add i32 %x2, 1<br>
-<br>
+  call void @extern()<br>
  ret i32 %x3<br>
}<br>
<br>
@@ -18,7 +18,7 @@ define i32 @callee2(i32 %x) {<br>
  %x1 = add i32 %x, 1<br>
  %x2 = add i32 %x1, 1<br>
  %x3 = add i32 %x2, 1<br>
-<br>
+  call void @extern()<br>
  ret i32 %x3<br>
}<br>
<br>
@@ -32,6 +32,8 @@ define i32 @caller2(i32 %y1) {<br>
  ret i32 %y3<br>
}<br>
<br>
+declare void @extern()<br>
+<br>
!llvm.module.flags = !{!1}<br>
!21 = !{!"branch_weights", i64 300}<br>
!22 = !{!"branch_weights", i64 1}<br>
<br>
Modified: llvm/trunk/test/Transforms/Inl<wbr>ine/inline-optsize.ll<br>
URL:<span class="m_2280295795711151765Apple-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">http://llvm.org/viewvc/<wbr>llvm-project/llvm/trunk/test/T<wbr>ransforms/Inline/inline-optsiz<wbr>e.ll?rev=286814&r1=286813&r2=<wbr>286814&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Transforms/Inl<wbr>ine/inline-optsize.ll (original)<br>
+++ llvm/trunk/test/Transforms/Inl<wbr>ine/inline-optsize.ll Mon Nov 14 05:14:41 2016<br>
@@ -12,6 +12,7 @@<br>
; This function should be larger than the inline threshold for -Oz (25), but<br>
; smaller than the inline threshold for optsize (75).<br>
define i32 @inner() {<br>
+  call void @extern()<br>
  %a1 = load volatile i32, i32* @a<br>
  %x1 = add i32 %a1,  %a1<br>
  %a2 = load volatile i32, i32* @a<br>
@@ -42,3 +43,5 @@ define i32 @outer2() minsize {<br>
   %r = call i32 @inner()<br>
   ret i32 %r<br>
}<br>
+<br>
+declare void @extern()<br>
\ No newline at end of file<br>
<br>
Modified: llvm/trunk/test/Transforms/Inl<wbr>ine/inline_unreachable-2.ll<br>
URL:<span class="m_2280295795711151765Apple-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">http://llvm.org/viewvc/<wbr>llvm-project/llvm/trunk/test/T<wbr>ransforms/Inline/inline_unreac<wbr>hable-2.ll?rev=286814&r1=<wbr>286813&r2=286814&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Transforms/Inl<wbr>ine/inline_unreachable-2.ll (original)<br>
+++ llvm/trunk/test/Transforms/Inl<wbr>ine/inline_unreachable-2.ll Mon Nov 14 05:14:41 2016<br>
@@ -8,6 +8,7 @@ define void @caller(i32 %a, i1 %b) #0 {<br>
}<br>
<br>
define void @callee(i32 %a, i1 %b) {<br>
+  call void @extern()<br>
  call void asm sideeffect "", ""()<br>
  br i1 %b, label %bb1, label %bb2<br>
bb1:<br>
@@ -17,3 +18,5 @@ bb2:<br>
  call void asm sideeffect "", ""()<br>
  ret void<br>
}<br>
+<br>
+declare void @extern()<br>
\ No newline at end of file<br>
<br>
Modified: llvm/trunk/test/Transforms/Inl<wbr>ine/optimization-remarks-passe<wbr>d-yaml.ll<br>
URL:<span class="m_2280295795711151765Apple-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">http://llvm.org/viewvc/<wbr>llvm-project/llvm/trunk/test/T<wbr>ransforms/Inline/optimization-<wbr>remarks-passed-yaml.ll?rev=<wbr>286814&r1=286813&r2=286814&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Transforms/Inl<wbr>ine/optimization-remarks-passe<wbr>d-yaml.ll (original)<br>
+++ llvm/trunk/test/Transforms/Inl<wbr>ine/optimization-remarks-passe<wbr>d-yaml.ll Mon Nov 14 05:14:41 2016<br>
@@ -12,7 +12,7 @@<br>
;  4       return foo();<br>
;  5     }<br>
<br>
-; CHECK:      remark: /tmp/s.c:4:10: foo can be inlined into bar with cost={{[0-9]+}} (threshold={{[0-9]+}}) (hotness: 30)<br>
+; CHECK:      remark: /tmp/s.c:4:10: foo can be inlined into bar with cost={{[0-9\-]+}} (threshold={{[0-9]+}}) (hotness: 30)<br>
; CHECK-NEXT: remark: /tmp/s.c:4:10: foo inlined into bar (hotness: 30)<br>
<br>
; YAML:      --- !Analysis<br>
@@ -28,7 +28,7 @@<br>
; YAML-NEXT:   - Caller: bar<br>
; YAML-NEXT:     DebugLoc:        { File: /tmp/s.c, Line: 3, Column: 0 }<br>
; YAML-NEXT:   - String: ' with cost='<br>
-; YAML-NEXT:   - Cost: '{{[0-9]+}}'<br>
+; YAML-NEXT:   - Cost: '{{[0-9\-]+}}'<br>
; YAML-NEXT:   - String: ' (threshold='<br>
; YAML-NEXT:   - Threshold: '{{[0-9]+}}'<br>
; YAML-NEXT:   - String: ')'<br>
<br>
Modified: llvm/trunk/test/Transforms/Inl<wbr>ine/ptr-diff.ll<br>
URL:<span class="m_2280295795711151765Apple-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">http://llvm.org/viewvc/<wbr>llvm-project/llvm/trunk/test/T<wbr>ransforms/Inline/ptr-diff.ll?r<wbr>ev=286814&r1=286813&r2=286814&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- llvm/trunk/test/Transforms/Inl<wbr>ine/ptr-diff.ll (original)<br>
+++ llvm/trunk/test/Transforms/Inl<wbr>ine/ptr-diff.ll Mon Nov 14 05:14:41 2016<br>
@@ -4,7 +4,7 @@ target datalayout = "p:32:32-p1:64:64-p2<br>
<br>
define i32 @outer1() {<br>
; CHECK-LABEL: @outer1(<br>
-; CHECK-NOT: call<br>
+; CHECK-NOT: call i32<br>
; CHECK: ret i32<br>
<br>
  %ptr = alloca i32<br>
@@ -15,6 +15,7 @@ define i32 @outer1() {<br>
}<br>
<br>
define i32 @inner1(i32* %begin, i32* %end) {<br>
+  call void @extern()<br>
  %begin.i = ptrtoint i32* %begin to i32<br>
  %end.i = ptrtoint i32* %end to i32<br>
  %distance = sub i32 %end.i, %begin.i<br>
@@ -43,6 +44,7 @@ define i32 @outer2(i32* %ptr) {<br>
}<br>
<br>
define i32 @inner2(i32* %begin, i32* %end) {<br>
+  call void @extern()<br>
  %begin.i = ptrtoint i32* %begin to i32<br>
  %end.i = ptrtoint i32* %end to i32<br>
  %distance = sub i32 %end.i, %begin.i<br>
@@ -60,6 +62,7 @@ else:<br>
; The inttoptrs are free since it is a smaller integer to a larger<br>
; pointer size<br>
define i32 @inttoptr_free_cost(i32 %a, i32 %b, i32 %c) {<br>
+  call void @extern()<br>
  %p1 = inttoptr i32 %a to i32 addrspace(1)*<br>
  %p2 = inttoptr i32 %b to i32 addrspace(1)*<br>
  %p3 = inttoptr i32 %c to i32 addrspace(1)*<br>
@@ -73,7 +76,7 @@ define i32 @inttoptr_free_cost(i32 %a, i<br>
<br>
define i32 @inttoptr_free_cost_user(i32 %begin, i32 %end) {<br>
; CHECK-LABEL: @inttoptr_free_cost_user(<br>
-; CHECK-NOT: call<br>
+; CHECK-NOT: call i32<br>
  %x = call i32 @inttoptr_free_cost(i32 %begin, i32 %end, i32 9)<br>
  ret i32 %x<br>
}<br>
@@ -81,6 +84,7 @@ define i32 @inttoptr_free_cost_user(i32<br>
; The inttoptrs have a cost since it is a larger integer to a smaller<br>
; pointer size<br>
define i32 @inttoptr_cost_smaller_ptr(i32 %a, i32 %b, i32 %c) {<br>
+  call void @extern()<br>
  %p1 = inttoptr i32 %a to i32 addrspace(2)*<br>
  %p2 = inttoptr i32 %b to i32 addrspace(2)*<br>
  %p3 = inttoptr i32 %c to i32 addrspace(2)*<br>
@@ -94,8 +98,9 @@ define i32 @inttoptr_cost_smaller_ptr(i3<br>
<br>
define i32 @inttoptr_cost_smaller_ptr_use<wbr>r(i32 %begin, i32 %end) {<br>
; CHECK-LABEL: @inttoptr_cost_smaller_ptr_use<wbr>r(<br>
-; CHECK: call<br>
+; CHECK: call i32<br>
  %x = call i32 @inttoptr_cost_smaller_ptr(i32 %begin, i32 %end, i32 9)<br>
  ret i32 %x<br>
}<br>
<br>
+declare void @extern()<br>
\ No newline at end of file<br>
<br>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-commits</a></blockquote>
</div>
</div>
</blockquote>
</div>
<br></div></div>
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.
</div>

</blockquote></div><br></div></div>