Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Profile] preserve branch metadata lowering select in CGP
CGP currently drops select's MD_prof profile data when generating conditional branch which can lead to bad code layout. The patch fixes the issue. Differential Revision: http://reviews.llvm.org/D24169 llvm-svn: 280600
- Loading branch information
Showing
4 changed files
with
42 additions
and
8 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
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,16 @@ | ||
; RUN: llc -mtriple=x86_64-unknown-unknown -print-after-all < %s 2>&1 | FileCheck %s | ||
|
||
; Function Attrs: norecurse nounwind readnone uwtable | ||
define i32 @foo(i32, i32, i32) { | ||
%4 = and i32 %0, 3 | ||
%5 = icmp eq i32 %4, 1 | ||
%6 = select i1 %5, i32 %1, i32 %2, !prof !1 | ||
; CHECK: br {{.*}}label{{.*}}, label{{.*}}, !prof ![[WT:.*]] | ||
ret i32 %6 | ||
} | ||
|
||
!llvm.ident = !{!0} | ||
|
||
!0 = !{!"clang version 4.0.0 (trunk 279683)"} | ||
!1 = !{!"branch_weights", i32 1000, i32 1 } | ||
; CHECK ![[WT]] = !{!"branch_weights", i32 1000, i32 1 } |