<div dir="ltr">Thanks a lot!<div><br></div><div>Committed as of r267908.</div><div><br></div><div>-Rong</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 28, 2016 at 10:38 AM, Ismail Donmez <span dir="ltr"><<a href="mailto:ismail@i10z.com" target="_blank">ismail@i10z.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yes that fixes it! Please commit, thanks!<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Apr 28, 2016 at 7:53 PM, Rong Xu <<a href="mailto:xur@google.com">xur@google.com</a>> wrote:<br>
> It seems the use of Twine to output remar message is not valid. I should not<br>
> store a temporal Twine.<br>
><br>
> Ismall: could you help to check if the attached patch solve the issue?<br>
> Thanks a lot!<br>
><br>
> -Rong<br>
><br>
> On Thu, Apr 28, 2016 at 9:21 AM, Ismail Donmez <<a href="mailto:ismail@i10z.com">ismail@i10z.com</a>> wrote:<br>
>><br>
>> Here:<br>
>><br>
>> win7-vbox ~ > "C:/cygwin64/home/ismail/src/llvm/dist/./bin\opt.EXE" <<br>
>><br>
>> "C:\cygwin64\home\ismail\src\llvm\test\Transforms\PGOProfile\icp_mismatch_msg.ll"<br>
>> -pgo-icall-prom -pass-remarks-missed=PGOIndirectCallPromotion -S 2>& 1<br>
>> remark: <unknown>:0:0: : The number of arguments mismatch<br>
>> remark: <unknown>:0:0: : Cannot find the target<br>
>> remark: <unknown>:0:0: : Return type mismatch<br>
>> ; ModuleID = '<stdin>'<br>
>> source_filename = "<stdin>"<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>
>> @foo = common global i32 ()* null, align 8<br>
>> @foo2 = common global i32 ()* null, align 8<br>
>> @foo3 = common global i32 ()* null, align 8<br>
>><br>
>> define i32 @func4(i32 %i) {<br>
>> entry:<br>
>> ret i32 %i<br>
>> }<br>
>><br>
>> define void @func2() {<br>
>> entry:<br>
>> ret void<br>
>> }<br>
>><br>
>> define i32 @bar() {<br>
>> entry:<br>
>> %tmp = load i32 ()*, i32 ()** @foo, align 8<br>
>> %call = call i32 %tmp(), !prof !0<br>
>> %tmp2 = load i32 ()*, i32 ()** @foo2, align 8<br>
>> %call1 = call i32 %tmp2(), !prof !1<br>
>> %add = add nsw i32 %call1, %call<br>
>> %tmp3 = load i32 ()*, i32 ()** @foo3, align 8<br>
>> %call2 = call i32 %tmp3(), !prof !2<br>
>> %add2 = add nsw i32 %add, %call2<br>
>> ret i32 %add2<br>
>> }<br>
>><br>
>> !0 = !{!"VP", i32 0, i64 1801, i64 7651369219802541373, i64 1234, i64<br>
>> -4377547752858689819, i64 567}<br>
>> !1 = !{!"VP", i32 0, i64 3023, i64 -6929281286627296573, i64 2345, i64<br>
>> -4377547752858689819, i64 678}<br>
>> !2 = !{!"VP", i32 0, i64 7890, i64 -4377547752858689819, i64 7890}<br>
>><br>
>> win7-vbox ~ > "C:/cygwin64/home/ismail/src/llvm/dist/./bin\opt.EXE" <<br>
>> "C:\cygwin64\home\ismail\src\llvm\test\Transforms\PGOPro<br>
>> file\indirect_call_promotion.ll" -pgo-icall-prom -S<br>
>> -pass-remarks=PGOIndirectCallPromotion -icp-count-threshold=0<br>
>> -icp-percent<br>
>> -threshold=0 -icp-max-prom=4 2>&1<br>
>> remark: <unknown>:0:0: 1600<br>
>> remark: <unknown>:0:0: 570<br>
>> remark: <unknown>:0:0: 160<br>
>> remark: <unknown>:0:0: 10<br>
>> ; ModuleID = '<stdin>'<br>
>> source_filename = "<stdin>"<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>
>> @foo = common global i32 ()* null, align 8<br>
>><br>
>> define i32 @func1() {<br>
>> entry:<br>
>> ret i32 0<br>
>> }<br>
>><br>
>> define i32 @func2() {<br>
>> entry:<br>
>> ret i32 1<br>
>> }<br>
>><br>
>> define i32 @func3() {<br>
>> entry:<br>
>> ret i32 2<br>
>> }<br>
>><br>
>> define i32 @func4() {<br>
>> entry:<br>
>> ret i32 3<br>
>> }<br>
>><br>
>> define i32 @bar() {<br>
>> entry:<br>
>> %tmp = load i32 ()*, i32 ()** @foo, align 8<br>
>> %0 = bitcast i32 ()* %tmp to i8*<br>
>> %1 = icmp eq i8* %0, bitcast (i32 ()* @func4 to i8*)<br>
>> br i1 %1, label %if.true.direct_targ, label %if.false.orig_indirect,<br>
>> !prof !0<br>
>><br>
>> if.true.direct_targ: ; preds = %entry<br>
>> %2 = call i32 @func4()<br>
>> br label %if.end.icp<br>
>><br>
>> if.false.orig_indirect: ; preds = %entry<br>
>> %3 = bitcast i32 ()* %tmp to i8*<br>
>> %4 = icmp eq i8* %3, bitcast (i32 ()* @func2 to i8*)<br>
>> br i1 %4, label %if.true.direct_targ1, label<br>
>> %if.false.orig_indirect2, !prof !1<br>
>><br>
>> if.true.direct_targ1: ; preds =<br>
>> %if.false.orig_indirect<br>
>> %5 = call i32 @func2()<br>
>> br label %if.end.icp3<br>
>><br>
>> if.false.orig_indirect2: ; preds =<br>
>> %if.false.orig_indirect<br>
>> %6 = bitcast i32 ()* %tmp to i8*<br>
>> %7 = icmp eq i8* %6, bitcast (i32 ()* @func3 to i8*)<br>
>> br i1 %7, label %if.true.direct_targ4, label<br>
>> %if.false.orig_indirect5, !prof !2<br>
>><br>
>> if.true.direct_targ4: ; preds =<br>
>> %if.false.orig_indirect2<br>
>> %8 = call i32 @func3()<br>
>> br label %if.end.icp6<br>
>><br>
>> if.false.orig_indirect5: ; preds =<br>
>> %if.false.orig_indirect2<br>
>> %9 = bitcast i32 ()* %tmp to i8*<br>
>> %10 = icmp eq i8* %9, bitcast (i32 ()* @func1 to i8*)<br>
>> br i1 %10, label %if.true.direct_targ7, label<br>
>> %if.false.orig_indirect8, !prof !3<br>
>><br>
>> if.true.direct_targ7: ; preds =<br>
>> %if.false.orig_indirect5<br>
>> %11 = call i32 @func1()<br>
>> br label %if.end.icp9<br>
>><br>
>> if.false.orig_indirect8: ; preds =<br>
>> %if.false.orig_indirect5<br>
>> %call = call i32 %tmp()<br>
>> br label %if.end.icp9<br>
>><br>
>> if.end.icp9: ; preds =<br>
>> %if.false.orig_indirect8, %if.true.direct_targ7<br>
>> %12 = phi i32 [ %call, %if.false.orig_indirect8 ], [ %11,<br>
>> %if.true.direct_targ7 ]<br>
>> br label %if.end.icp6<br>
>><br>
>> if.end.icp6: ; preds =<br>
>> %if.end.icp9, %if.true.direct_targ4<br>
>> %13 = phi i32 [ %12, %if.end.icp9 ], [ %8, %if.true.direct_targ4 ]<br>
>> br label %if.end.icp3<br>
>><br>
>> if.end.icp3: ; preds =<br>
>> %if.end.icp6, %if.true.direct_targ1<br>
>> %14 = phi i32 [ %13, %if.end.icp6 ], [ %5, %if.true.direct_targ1 ]<br>
>> br label %if.end.icp<br>
>><br>
>> if.end.icp: ; preds =<br>
>> %if.end.icp3, %if.true.direct_targ<br>
>> %15 = phi i32 [ %14, %if.end.icp3 ], [ %2, %if.true.direct_targ ]<br>
>> ret i32 %15<br>
>> }<br>
>><br>
>> !0 = !{!"branch_weights", i32 1030, i32 570}<br>
>> !1 = !{!"branch_weights", i32 410, i32 160}<br>
>> !2 = !{!"branch_weights", i32 150, i32 10}<br>
>> !3 = !{!"branch_weights", i32 10, i32 0}<br>
>><br>
>> On Thu, Apr 28, 2016 at 6:53 PM, Xinliang David Li <<a href="mailto:xinliangli@gmail.com">xinliangli@gmail.com</a>><br>
>> wrote:<br>
>> > what I meant is the output that gets piped to FileCheck, not the<br>
>> > FileCheck<br>
>> > output.<br>
>> ><br>
>> > thanks,<br>
>> ><br>
>> > David<br>
>> ><br>
>> > On Thu, Apr 28, 2016 at 8:48 AM, Ismail Donmez <<a href="mailto:ismail@i10z.com">ismail@i10z.com</a>> wrote:<br>
>> >><br>
>> >> That's all of the output (excluding the command line part).<br>
>> >><br>
>> >> On Thu, Apr 28, 2016 at 6:46 PM, Xinliang David Li<br>
>> >> <<a href="mailto:xinliangli@gmail.com">xinliangli@gmail.com</a>><br>
>> >> wrote:<br>
>> >> > What does the actual output look like?<br>
>> >> ><br>
>> >> > David<br>
>> >> ><br>
>> >> > On Thu, Apr 28, 2016 at 1:57 AM, Ismail Donmez via llvm-commits<br>
>> >> > <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
>> >> >><br>
>> >> >> Hi,<br>
>> >> >><br>
>> >> >> On Thu, Apr 28, 2016 at 2:20 AM, Rong Xu via llvm-commits<br>
>> >> >> <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
>> >> >> > Author: xur<br>
>> >> >> > Date: Wed Apr 27 18:20:27 2016<br>
>> >> >> > New Revision: 267815<br>
>> >> >> ><br>
>> >> >> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=267815&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=267815&view=rev</a><br>
>> >> >> > Log:<br>
>> >> >> > [PGO] Promote indirect calls to conditional direct calls with<br>
>> >> >> > value-profile<br>
>> >> >> ><br>
>> >> >> > This patch implements the transformation that promotes indirect<br>
>> >> >> > calls<br>
>> >> >> > to<br>
>> >> >> > conditional direct calls when the indirect-call value profile<br>
>> >> >> > meta-data<br>
>> >> >> > is<br>
>> >> >> > available.<br>
>> >> >> ><br>
>> >> >> > Differential Revision: <a href="http://reviews.llvm.org/D17864" rel="noreferrer" target="_blank">http://reviews.llvm.org/D17864</a><br>
>> >> >> ><br>
>> >> >> > Added:<br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> > llvm/trunk/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp<br>
>> >> >> ><br>
>> >> >> > llvm/trunk/test/Transforms/PGOProfile/icp_covariant_call_return.ll<br>
>> >> >> ><br>
>> >> >> ><br>
>> >> >> > llvm/trunk/test/Transforms/PGOProfile/icp_covariant_invoke_return.ll<br>
>> >> >> > llvm/trunk/test/Transforms/PGOProfile/icp_invoke.ll<br>
>> >> >> > llvm/trunk/test/Transforms/PGOProfile/icp_mismatch_msg.ll<br>
>> >> >> > llvm/trunk/test/Transforms/PGOProfile/icp_vararg.ll<br>
>> >> >> ><br>
>> >> >> > llvm/trunk/test/Transforms/PGOProfile/indirect_call_promotion.ll<br>
>> >> >> > Modified:<br>
>> >> >> > llvm/trunk/include/llvm/InitializePasses.h<br>
>> >> >> > llvm/trunk/include/llvm/LinkAllPasses.h<br>
>> >> >> > llvm/trunk/include/llvm/Transforms/Instrumentation.h<br>
>> >> >> > llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp<br>
>> >> >> > llvm/trunk/lib/Transforms/Instrumentation/CMakeLists.txt<br>
>> >> >> > llvm/trunk/lib/Transforms/Instrumentation/Instrumentation.cpp<br>
>> >> >><br>
>> >> >> Fails with VS2015 x64:<br>
>> >> >><br>
>> >> >><br>
>> >> >><br>
>> >> >><br>
>> >> >> C:\cygwin64\home\ismail\src\llvm\test\Transforms\PGOProfile\icp_mismatch_msg.ll:3:10:<br>
>> >> >> error: expected string not found in input<br>
>> >> >> ; CHECK: remark: <unknown>:0:0: Cannot promote indirect call to<br>
>> >> >> func4<br>
>> >> >> with count of 1234: The number of arguments mismatch<br>
>> >> >> ^<br>
>> >> >> <stdin>:1:1: note: scanning from here<br>
>> >> >> remark: <unknown>:0:0: : The number of arguments mismatch<br>
>> >> >> ^<br>
>> >> >><br>
>> >> >><br>
>> >> >><br>
>> >> >><br>
>> >> >> C:\cygwin64\home\ismail\src\llvm\test\Transforms\PGOProfile\indirect_call_promotion.ll:3:16:<br>
>> >> >> error: expected string not found in input<br>
>> >> >> ; PASS-REMARK: remark: <unknown>:0:0: Promote indirect call to func4<br>
>> >> >> with count 1030 out of 1600<br>
>> >> >> ^<br>
>> >> >> <stdin>:1:1: note: scanning from here<br>
>> >> >> remark: <unknown>:0:0: 1600<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>
>> >> ><br>
>> >> ><br>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>