[PATCH] D40662: [PGO] Do not do counter promotion for loops without exit blocks ('infinite loops')

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 11:06:09 PST 2017


It can't hurt!

This lgtm with an IR test.

Thank you,
vedant

> On Nov 30, 2017, at 11:05 AM, Xinliang David Li <davidxl at google.com> wrote:
> 
> Sure I will add an IR based test case. The end-to-end test is still good to have though .
> 
> David
> 
> On Thu, Nov 30, 2017 at 11:02 AM, Vedant Kumar via Phabricator <reviews at reviews.llvm.org <mailto:reviews at reviews.llvm.org>> wrote:
> vsk added a comment.
> 
> With an IR-based test case, https://reviews.llvm.org/D40663 <https://reviews.llvm.org/D40663> shouldn't be necessary --
> 
>   ; RUN opt -instrprof -S -o - <%s -do-counter-promotion=1 | FileCheck
>   ; CHECK: store
> 
>   target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
>   target triple = "x86_64-apple-macosx10.12.0"
> 
>   @__profn_foo = private constant [3 x i8] c"foo"
> 
>   define void @foo() {
>   entry:
>     br label %while.body
> 
>   while.body:                                       ; preds = %entry, %while.body
>     call void @llvm.instrprof.increment(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__profn_foo, i32 0, i32 0), i64 14813359968, i32 1, i32 0)
>     call void (...) @bar() #2
>     br label %while.body
>   }
> 
>   declare void @bar(...)
> 
>   declare void @llvm.instrprof.increment(i8*, i64, i32, i32) #0
> 
>   attributes #0 = { nounwind }
> 
>   !llvm.module.flags = !{!0, !1}
>   !llvm.ident = !{!2}
> 
>   !0 = !{i32 1, !"wchar_size", i32 4}
>   !1 = !{i32 7, !"PIC Level", i32 2}
>   !2 = !{!"clang version 6.0.0 (trunk 319373) (llvm/trunk 319391)"}
> 
> 
> https://reviews.llvm.org/D40662 <https://reviews.llvm.org/D40662>
> 
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171130/1b783556/attachment.html>


More information about the llvm-commits mailing list