If PrototypeValue is erased in the middle of using the SSAUpdator
[oota-llvm.git] / test / CodeGen / Blackfin / addsub-i128.ll
1 ; RUN: llc < %s -march=bfin -verify-machineinstrs
2
3 ; These functions have just the right size to annoy the register scavenger: They
4 ; use all the scratch registers, but not all the callee-saved registers.
5
6 define void @test_add(i64 %AL, i64 %AH, i64 %BL, i64 %BH, i64* %RL, i64* %RH) {
7 entry:
8         %tmp1 = zext i64 %AL to i128            ; <i128> [#uses=1]
9         %tmp23 = zext i64 %AH to i128           ; <i128> [#uses=1]
10         %tmp4 = shl i128 %tmp23, 64             ; <i128> [#uses=1]
11         %tmp5 = or i128 %tmp4, %tmp1            ; <i128> [#uses=1]
12         %tmp67 = zext i64 %BL to i128           ; <i128> [#uses=1]
13         %tmp89 = zext i64 %BH to i128           ; <i128> [#uses=1]
14         %tmp11 = shl i128 %tmp89, 64            ; <i128> [#uses=1]
15         %tmp12 = or i128 %tmp11, %tmp67         ; <i128> [#uses=1]
16         %tmp15 = add i128 %tmp12, %tmp5         ; <i128> [#uses=2]
17         %tmp1617 = trunc i128 %tmp15 to i64             ; <i64> [#uses=1]
18         store i64 %tmp1617, i64* %RL
19         %tmp21 = lshr i128 %tmp15, 64           ; <i128> [#uses=1]
20         %tmp2122 = trunc i128 %tmp21 to i64             ; <i64> [#uses=1]
21         store i64 %tmp2122, i64* %RH
22         ret void
23 }
24
25 define void @test_sub(i64 %AL, i64 %AH, i64 %BL, i64 %BH, i64* %RL, i64* %RH) {
26 entry:
27         %tmp1 = zext i64 %AL to i128            ; <i128> [#uses=1]
28         %tmp23 = zext i64 %AH to i128           ; <i128> [#uses=1]
29         %tmp4 = shl i128 %tmp23, 64             ; <i128> [#uses=1]
30         %tmp5 = or i128 %tmp4, %tmp1            ; <i128> [#uses=1]
31         %tmp67 = zext i64 %BL to i128           ; <i128> [#uses=1]
32         %tmp89 = zext i64 %BH to i128           ; <i128> [#uses=1]
33         %tmp11 = shl i128 %tmp89, 64            ; <i128> [#uses=1]
34         %tmp12 = or i128 %tmp11, %tmp67         ; <i128> [#uses=1]
35         %tmp15 = sub i128 %tmp5, %tmp12         ; <i128> [#uses=2]
36         %tmp1617 = trunc i128 %tmp15 to i64             ; <i64> [#uses=1]
37         store i64 %tmp1617, i64* %RL
38         %tmp21 = lshr i128 %tmp15, 64           ; <i128> [#uses=1]
39         %tmp2122 = trunc i128 %tmp21 to i64             ; <i64> [#uses=1]
40         store i64 %tmp2122, i64* %RH
41         ret void
42 }