[PATCH] D40662: [PGO] Do not do counter promotion for loops without exit blocks ('infinite loops')
Xinliang David Li via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 30 11:05:17 PST 2017
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> wrote:
> vsk added a comment.
>
> With an IR-based test case, 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
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171130/63bbf131/attachment.html>
More information about the llvm-commits
mailing list