forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FastISel][X86] - Add branch weights
Add branch weights to branch instructions, so that the following passes can optimize based on it (i.e. basic block ordering). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210863 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
3 changed files
with
41 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | FileCheck %s | ||
; RUN: llc < %s -fast-isel -fast-isel-abort -mtriple=x86_64-apple-darwin10 | FileCheck %s | ||
|
||
; Test if the BBs are reordred according to their branch weights. | ||
define i64 @branch_weights_test(i64 %a, i64 %b) { | ||
; CHECK-LABEL: branch_weights_test | ||
; CHECK-LABEL: success | ||
; CHECK-LABEL: fail | ||
%1 = icmp ult i64 %a, %b | ||
br i1 %1, label %fail, label %success, !prof !0 | ||
|
||
fail: | ||
ret i64 -1 | ||
|
||
success: | ||
ret i64 0 | ||
} | ||
|
||
!0 = metadata !{metadata !"branch_weights", i32 0, i32 2147483647} |