Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PGO] Skip counter promotion for infinite loops
Differential Revision: http://reviews.llvm.org/D40662 llvm-svn: 319462
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
; RUN: opt < %s -instrprof -S -o - -do-counter-promotion=1 | FileCheck %s | ||
; CHECK: store | ||
|
||
@__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 } | ||
|