<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 24, 2015 at 2:50 PM, Rong Xu via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: xur<br>
Date: Tue Nov 24 16:50:34 2015<br>
New Revision: 254035<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=254035&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=254035&view=rev</a><br>
Log:<br>
[PGO] Relax test cases in PGO instrumentation<br>
<br>
Fix buildbot failure for clang-x86_64-linux-selfhost-modules.<br>
<a href="http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/8866" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/8866</a><br>
The failing test cases are newly added from r254021. It seems the IR has a<br>
different order in this platform. In this patch, I temporarily relax the test<br>
case to make the build green. I'll have a complete fix (more robust way to test)<br>
soon.<br>
<br>
Modified:<br>
llvm/trunk/test/Transforms/PGOProfile/criticaledge_gen.ll<br>
llvm/trunk/test/Transforms/PGOProfile/criticaledge_use.ll<br>
llvm/trunk/test/Transforms/PGOProfile/loop3_gen.ll<br>
llvm/trunk/test/Transforms/PGOProfile/loop3_use.ll<br>
llvm/trunk/test/Transforms/PGOProfile/noprofile_use.ll<br>
llvm/trunk/test/Transforms/PGOProfile/switch_gen.ll<br>
llvm/trunk/test/Transforms/PGOProfile/switch_use.ll<br>
<br>
Modified: llvm/trunk/test/Transforms/PGOProfile/criticaledge_gen.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/criticaledge_gen.ll?rev=254035&r1=254034&r2=254035&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/criticaledge_gen.ll?rev=254035&r1=254034&r2=254035&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/Transforms/PGOProfile/criticaledge_gen.ll (original)<br>
+++ llvm/trunk/test/Transforms/PGOProfile/criticaledge_gen.ll Tue Nov 24 16:50:34 2015<br>
@@ -18,20 +18,16 @@ entry:<br>
]<br>
<br>
; CHECK: entry.sw.bb3_crit_edge1:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 1)<br>
; CHECK: br label %sw.bb3<br>
<br>
; CHECK: entry.sw.bb3_crit_edge:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 0)<br>
; CHECK: br label %sw.bb3<br>
<br>
<a href="http://sw.bb" rel="noreferrer" target="_blank">sw.bb</a>:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 5)<br>
%call = call i32 @_ZL3bari(i32 2)<br>
br label %sw.epilog<br>
<br>
sw.bb1:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 4)<br>
%call2 = call i32 @_ZL3bari(i32 1024)<br>
br label %sw.epilog<br>
<br>
@@ -40,23 +36,19 @@ sw.bb3:<br>
br i1 %cmp, label %if.then, label %if.end<br>
<br>
if.then:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 2)<br>
%call4 = call i32 @_ZL3bari(i32 4)<br>
br label %return<br>
<br>
if.end:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 3)<br>
%call5 = call i32 @_ZL3bari(i32 8)<br>
br label %sw.epilog<br>
<br>
sw.default:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 6)<br>
%call6 = call i32 @_ZL3bari(i32 32)<br>
%cmp7 = icmp sgt i32 %j, 10<br>
br i1 %cmp7, label %if.then8, label %if.end9<br>
<br>
if.then8:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__llvm_profile_name__Z17test_criticalEdgeii, i32 0, i32 0), i64 82348442248, i32 8, i32 7)<br>
%add = add nsw i32 %call6, 10<br>
br label %if.end9<br>
<br>
@@ -75,6 +67,5 @@ return:<br>
<br>
define internal i32 @_ZL3bari(i32 %i) {<br>
entry:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @"__llvm_profile_name_<stdin>:_ZL3bari", i32 0, i32 0), i64 12884901887, i32 1, i32 0)<br>
ret i32 %i<br>
}<br>
<br>
Modified: llvm/trunk/test/Transforms/PGOProfile/criticaledge_use.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/criticaledge_use.ll?rev=254035&r1=254034&r2=254035&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/criticaledge_use.ll?rev=254035&r1=254034&r2=254035&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/Transforms/PGOProfile/criticaledge_use.ll (original)<br>
+++ llvm/trunk/test/Transforms/PGOProfile/criticaledge_use.ll Tue Nov 24 16:50:34 2015<br>
@@ -14,7 +14,7 @@ entry:<br>
; CHECK: i32 4, label %entry.sw.bb3_crit_edge1<br>
i32 5, label %sw.bb3<br>
]<br>
-; CHECK: !prof !0<br>
+; CHECK: !prof !<br>
<br>
; CHECK: entry.sw.bb3_crit_edge1:<br>
; CHECK: br label %sw.bb3<br>
@@ -32,7 +32,7 @@ sw.bb1:<br>
sw.bb3:<br>
%cmp = icmp eq i32 %j, 2<br>
br i1 %cmp, label %if.then, label %if.end<br>
-; CHECK: !prof !1<br>
+; CHECK: !prof !<br>
<br>
if.then:<br>
%call4 = call i32 @_ZL3bari(i32 4)<br>
@@ -46,7 +46,7 @@ sw.default:<br>
%call6 = call i32 @_ZL3bari(i32 32)<br>
%cmp7 = icmp sgt i32 %j, 10<br>
br i1 %cmp7, label %if.then8, label %if.end9<br>
-; CHECK: !prof !2<br>
+; CHECK: !prof !<br>
<br>
if.then8:<br>
%add = add nsw i32 %call6, 10<br>
@@ -70,6 +70,5 @@ entry:<br>
ret i32 %i<br>
}<br>
<br>
-; CHECK: !0 = !{!"branch_weights", i32 2, i32 1, i32 0, i32 2, i32 1, i32 1}<br>
-; CHECK: !1 = !{!"branch_weights", i32 2, i32 2}<br>
-; CHECK: !2 = !{!"branch_weights", i32 1, i32 1}<br>
+; CHECK-DAG: !{!"branch_weights", i32 2, i32 2}<br>
+; CHECK-DAG: !{!"branch_weights", i32 1, i32 1}<br>
<br>
Modified: llvm/trunk/test/Transforms/PGOProfile/loop3_gen.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/loop3_gen.ll?rev=254035&r1=254034&r2=254035&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/loop3_gen.ll?rev=254035&r1=254034&r2=254035&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/Transforms/PGOProfile/loop3_gen.ll (original)<br>
+++ llvm/trunk/test/Transforms/PGOProfile/loop3_gen.ll Tue Nov 24 16:50:34 2015<br>
@@ -6,7 +6,6 @@ target triple = "x86_64-unknown-linux-gn<br>
<br>
define i32 @_Z15test_nested_foriii(i32 %r, i32 %s, i32 %t) {<br>
entry:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__llvm_profile_name__Z15test_nested_foriii, i32 0, i32 0), i64 75296580464, i32 4, i32 3)<br>
br label %for.cond<br>
<br>
for.cond:<br>
@@ -38,7 +37,6 @@ for.body6:<br>
br label %for.inc<br>
<br>
for.inc:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__llvm_profile_name__Z15test_nested_foriii, i32 0, i32 0), i64 75296580464, i32 4, i32 0)<br>
%inc7 = add nsw i32 %k.0, 1<br>
br label %for.cond4<br>
<br>
@@ -46,12 +44,10 @@ for.end:<br>
br label %for.inc8<br>
<br>
for.inc8:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__llvm_profile_name__Z15test_nested_foriii, i32 0, i32 0), i64 75296580464, i32 4, i32 1)<br>
%inc9 = add nsw i32 %j.0, 1<br>
br label %for.cond1<br>
<br>
for.end10:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__llvm_profile_name__Z15test_nested_foriii, i32 0, i32 0), i64 75296580464, i32 4, i32 2)<br>
br label %for.inc11<br>
<br>
for.inc11:<br>
<br>
Modified: llvm/trunk/test/Transforms/PGOProfile/loop3_use.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/loop3_use.ll?rev=254035&r1=254034&r2=254035&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/loop3_use.ll?rev=254035&r1=254034&r2=254035&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/Transforms/PGOProfile/loop3_use.ll (original)<br>
+++ llvm/trunk/test/Transforms/PGOProfile/loop3_use.ll Tue Nov 24 16:50:34 2015<br>
@@ -12,7 +12,7 @@ for.cond:<br>
%nested_for_sum.0 = phi i32 [ 1, %entry ], [ %nested_for_sum.1, %for.inc11 ]<br>
%cmp = icmp slt i32 %i.0, %r<br>
br i1 %cmp, label %for.body, label %for.end13<br>
-; CHECK: !prof !0<br>
+; CHECK: !prof<br>
<br>
for.body:<br>
br label %for.cond1<br>
@@ -22,7 +22,7 @@ for.cond1:<br>
%nested_for_sum.1 = phi i32 [ %nested_for_sum.0, %for.body ], [ %nested_for_sum.2, %for.inc8 ]<br>
%cmp2 = icmp slt i32 %j.0, %s<br>
br i1 %cmp2, label %for.body3, label %for.end10<br>
-; CHECK: !prof !1<br>
+; CHECK: !prof<br>
<br>
for.body3:<br>
br label %for.cond4<br>
@@ -32,7 +32,7 @@ for.cond4:<br>
%nested_for_sum.2 = phi i32 [ %nested_for_sum.1, %for.body3 ], [ %inc, %for.inc ]<br>
%cmp5 = icmp slt i32 %k.0, %t<br>
br i1 %cmp5, label %for.body6, label %for.end<br>
-; CHECK: !prof !2<br>
+; CHECK: !prof<br>
<br>
for.body6:<br>
%inc = add nsw i32 %nested_for_sum.2, 1<br>
@@ -60,6 +60,4 @@ for.end13:<br>
ret i32 %nested_for_sum.0<br>
}<br>
<br>
-; CHECK: !0 = !{!"branch_weights", i32 10, i32 6}<br>
-; CHECK: !1 = !{!"branch_weights", i32 33, i32 10}<br>
-; CHECK: !2 = !{!"branch_weights", i32 186, i32 33}<br>
+; CHECK: !{!"branch_weights"<br>
<br>
Modified: llvm/trunk/test/Transforms/PGOProfile/noprofile_use.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/noprofile_use.ll?rev=254035&r1=254034&r2=254035&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/noprofile_use.ll?rev=254035&r1=254034&r2=254035&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/Transforms/PGOProfile/noprofile_use.ll (original)<br>
+++ llvm/trunk/test/Transforms/PGOProfile/noprofile_use.ll Tue Nov 24 16:50:34 2015<br>
@@ -1,4 +1,4 @@<br>
-; RUN: not opt < %s -pgo-instr-use -pgo-profile-file=%T/notexisting.profdata -S 2>&1 |grep 'notexisting.profdata: No such file or directory'<br>
+; RUN: not opt < %s -pgo-instr-use -pgo-profile-file=%T/notexisting.profdata -S<br>
<br>
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"<br>
target triple = "x86_64-unknown-linux-gnu"<br>
<br>
Modified: llvm/trunk/test/Transforms/PGOProfile/switch_gen.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/switch_gen.ll?rev=254035&r1=254034&r2=254035&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/switch_gen.ll?rev=254035&r1=254034&r2=254035&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/Transforms/PGOProfile/switch_gen.ll (original)<br>
+++ llvm/trunk/test/Transforms/PGOProfile/switch_gen.ll Tue Nov 24 16:50:34 2015<br>
@@ -13,22 +13,18 @@ entry:<br>
]<br>
<br>
<a href="http://sw.bb" rel="noreferrer" target="_blank">sw.bb</a>:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__llvm_profile_name__Z13test_switch_1i, i32 0, i32 0), i64 46628225222, i32 4, i32 2)<br>
%add = add nsw i32 %i, 2<br>
br label %sw.epilog<br>
<br>
sw.bb1:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__llvm_profile_name__Z13test_switch_1i, i32 0, i32 0), i64 46628225222, i32 4, i32 0)<br>
%add2 = add nsw i32 %i, 100<br>
br label %sw.epilog<br>
<br>
sw.bb3:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__llvm_profile_name__Z13test_switch_1i, i32 0, i32 0), i64 46628225222, i32 4, i32 1)<br>
%add4 = add nsw i32 %i, 4<br>
br label %sw.epilog<br>
<br>
sw.default:<br>
-; CHECK: call void @llvm.instrprof.increment(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__llvm_profile_name__Z13test_switch_1i, i32 0, i32 0), i64 46628225222, i32 4, i32 3)<br>
%add5 = add nsw i32 %i, 1<br>
br label %sw.epilog<br>
<br>
<br>
Modified: llvm/trunk/test/Transforms/PGOProfile/switch_use.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/switch_use.ll?rev=254035&r1=254034&r2=254035&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PGOProfile/switch_use.ll?rev=254035&r1=254034&r2=254035&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/Transforms/PGOProfile/switch_use.ll (original)<br>
+++ llvm/trunk/test/Transforms/PGOProfile/switch_use.ll Tue Nov 24 16:50:34 2015<br>
@@ -33,4 +33,4 @@ sw.epilog:<br>
ret i32 %retv<br>
}<br>
<br>
-;CHECK: !0 = !{!"branch_weights", i32 3, i32 0, i32 0, i32 0}<br>
+; CHECK: !0 = !{!"branch_weights"<br></blockquote><div><br></div><div>This is not appropriate. It completely destroys the purpose of the test. The appropriate solution is to revert the patch until the issue is resolved.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">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/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>