1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00
llvm-mirror/test/CodeGen/X86/fast-isel-branch_weights.ll
Juergen Ributzka be48c6b01a [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).

llvm-svn: 210863
2014-06-13 00:45:11 +00:00

20 lines
564 B
LLVM

; 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}