mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 20:29:48 +00:00
3d253a3f80
Add branch weights to branch instructions, so that the following passes can optimize based on it (i.e. basic block ordering). Fixes <rdar://problem/17887137>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214537 91177308-0d34-0410-b5e6-96231b3b80d8
20 lines
612 B
LLVM
20 lines
612 B
LLVM
; RUN: llc -mtriple=arm64-apple-darwin -aarch64-atomic-cfg-tidy=0 < %s | FileCheck %s
|
|
; RUN: llc -mtriple=arm64-apple-darwin -aarch64-atomic-cfg-tidy=0 -fast-isel -fast-isel-abort < %s | 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}
|