Add a peephole optimization to optimize pairs of bitcasts. e.g.
[oota-llvm.git] / test / CodeGen / ARM / peephole-bitcast.ll
1 ; RUN: llc < %s -march=arm -mcpu=cortex-a8 | FileCheck %s
2
3 ; vmov s0, r0 + vmov r0, s0 should have been optimized away.
4 ; rdar://9104514
5
6 define void @t(float %x) nounwind ssp {
7 entry:
8 ; CHECK:     t:
9 ; CHECK-NOT: vmov
10 ; CHECK:     bl
11   %0 = bitcast float %x to i32
12   %cmp = icmp ult i32 %0, 2139095039
13   br i1 %cmp, label %if.then, label %if.end
14
15 if.then:                                          ; preds = %entry
16   tail call void @doSomething(float %x) nounwind
17   br label %if.end
18
19 if.end:                                           ; preds = %if.then, %entry
20   ret void
21 }
22
23 declare void @doSomething(float)