1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/CodeGen/Thumb2/ifcvt-compare.ll
Kyle Butt 9386601a22 CodeGen: Allow small copyable blocks to "break" the CFG.
When choosing the best successor for a block, ordinarily we would have preferred
a block that preserves the CFG unless there is a strong probability the other
direction. For small blocks that can be duplicated we now skip that requirement
as well, subject to some simple frequency calculations.

Differential Revision: https://reviews.llvm.org/D28583

llvm-svn: 293716
2017-01-31 23:48:32 +00:00

50 lines
709 B
LLVM

; RUN: llc -mtriple=thumbv7-unknown-linux %s -o - | FileCheck %s
declare void @x()
define void @f0(i32 %x) optsize {
; CHECK-LABEL: f0:
; CHECK: cbz
%p = icmp eq i32 %x, 0
br i1 %p, label %t, label %f
t:
call void @x()
br label %f
f:
ret void
}
define void @f1(i32 %x) optsize {
; CHECK-LABEL: f1:
; CHECK: cmp r0, #1
; CHECK: it ne
; CHECK-NEXT: bxne lr
%p = icmp eq i32 %x, 1
br i1 %p, label %t, label %f
t:
call void @x()
br label %f
f:
ret void
}
define void @f2(i32 %x) {
; CHECK-LABEL: f2:
; CHECK: cmp r0, #0
; CHECK: it ne
; CHECK-NEXT: bxne lr
%p = icmp eq i32 %x, 0
br i1 %p, label %t, label %f
t:
call void @x()
br label %f
f:
ret void
}