1 ; RUN: llc < %s -asm-verbose=false -O3 -mtriple=armv6-apple-darwin -relocation-model=pic -mcpu=arm1136jf-s -arm-atomic-cfg-tidy=0 | FileCheck %s
2 ; rdar://8959122 illegal register operands for UMULL instruction
3 ; in cfrac nightly test.
4 ; Armv6 generates a umull that must write to two distinct destination regs.
6 ; ModuleID = 'bugpoint-reduced-simplified.bc'
7 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:64-n32"
8 target triple = "armv6-apple-darwin10"
10 define void @ptoa(i1 %tst, i8* %p8, i8 %val8) nounwind {
12 br i1 false, label %bb3, label %bb
17 bb3: ; preds = %bb, %entry
18 %0 = call noalias i8* @malloc() nounwind
19 br i1 %tst, label %bb46, label %bb8
22 %1 = getelementptr inbounds i8, i8* %0, i32 0
23 store volatile i8 0, i8* %1, align 1
24 %2 = call i32 @ptou() nounwind
25 ; CHECK: umull [[REGISTER:lr|r[0-9]+]],
26 ; CHECK-NOT: [[REGISTER]],
27 ; CHECK: {{lr|r[0-9]+}}, {{lr|r[0-9]+$}}
28 ; CHECK: umull [[REGISTER:lr|r[0-9]+]],
29 ; CHECK-NOT: [[REGISTER]],
30 ; CHECK: {{lr|r[0-9]+}}, {{lr|r[0-9]+$}}
33 %5 = icmp ult i32 %4, 10
34 %6 = trunc i32 %4 to i8
37 %iftmp.5.0.1 = select i1 %5, i8 %7, i8 %8
38 store volatile i8 %iftmp.5.0.1, i8* %p8, align 1
39 ; CHECK: umull [[REGISTER:lr|r[0-9]+]],
40 ; CHECK-NOT: [[REGISTER]],
41 ; CHECK: {{lr|r[0-9]+}}, {{lr|r[0-9]+$}}
42 ; CHECK: umull [[REGISTER:lr|r[0-9]+]],
43 ; CHECK-NOT: [[REGISTER]],
44 ; CHECK: {{lr|r[0-9]+}}, {{lr|r[0-9]+$}}
47 %11 = icmp ult i32 %10, 10
48 %12 = trunc i32 %10 to i8
51 %iftmp.5.0.2 = select i1 %11, i8 %13, i8 %14
52 store volatile i8 %iftmp.5.0.2, i8* %p8, align 1
53 ; CHECK: umull [[REGISTER:lr|r[0-9]+]],
54 ; CHECK-NOT: [[REGISTER]],
55 ; CHECK: {{lr|r[0-9]+}}, {{lr|r[0-9]+$}}
56 ; CHECK: umull [[REGISTER:lr|r[0-9]+]],
57 ; CHECK-NOT: [[REGISTER]],
58 ; CHECK: {{lr|r[0-9]+}}, {{lr|r[0-9]+$}}
59 %15 = udiv i32 %2, 10000
60 %16 = urem i32 %15, 10
61 %17 = icmp ult i32 %16, 10
62 %18 = trunc i32 %16 to i8
65 %iftmp.5.0.4 = select i1 %17, i8 %19, i8 %20
66 store volatile i8 %iftmp.5.0.4, i8* null, align 1
67 ; CHECK: umull [[REGISTER:lr|r[0-9]+]],
68 ; CHECK-NOT: [[REGISTER]],
69 ; CHECK: {{lr|r[0-9]+}}, {{lr|r[0-9]+$}}
70 ; CHECK: umull [[REGISTER:lr|r[0-9]+]],
71 ; CHECK-NOT: [[REGISTER]],
72 ; CHECK: {{lr|r[0-9]+}}, {{lr|r[0-9]+$}}
73 %21 = udiv i32 %2, 100000
74 %22 = urem i32 %21, 10
75 %23 = icmp ult i32 %22, 10
76 %iftmp.5.0.5 = select i1 %23, i8 0, i8 %val8
77 store volatile i8 %iftmp.5.0.5, i8* %p8, align 1
78 ; CHECK: umull [[REGISTER:lr|r[0-9]+]],
79 ; CHECK-NOT: [[REGISTER]],
80 ; CHECK: {{lr|r[0-9]+}}, {{lr|r[0-9]+$}}
81 ; CHECK: umull [[REGISTER:lr|r[0-9]+]],
82 ; CHECK-NOT: [[REGISTER]],
83 ; CHECK: {{lr|r[0-9]+}}, {{lr|r[0-9]+$}}
84 %24 = udiv i32 %2, 1000000
85 %25 = urem i32 %24, 10
86 %26 = icmp ult i32 %25, 10
87 %27 = trunc i32 %25 to i8
90 %iftmp.5.0.6 = select i1 %26, i8 %28, i8 %29
91 store volatile i8 %iftmp.5.0.6, i8* %p8, align 1
92 ; CHECK: umull [[REGISTER:lr|r[0-9]+]],
93 ; CHECK-NOT: [[REGISTER]],
94 ; CHECK: {{lr|r[0-9]+}}, {{lr|r[0-9]+$}}
95 ; CHECK: umull [[REGISTER:lr|r[0-9]+]],
96 ; CHECK-NOT: [[REGISTER]],
97 ; CHECK: {{lr|r[0-9]+}}, {{lr|r[0-9]+$}}
98 %30 = udiv i32 %2, 10000000
99 %31 = urem i32 %30, 10
100 %32 = icmp ult i32 %31, 10
101 %33 = trunc i32 %31 to i8
104 %iftmp.5.0.7 = select i1 %32, i8 %34, i8 %35
105 store volatile i8 %iftmp.5.0.7, i8* %p8, align 1
106 %36 = udiv i32 %2, 100000000
107 %37 = urem i32 %36, 10
108 %38 = icmp ult i32 %37, 10
109 %39 = trunc i32 %37 to i8
112 %iftmp.5.0.8 = select i1 %38, i8 %40, i8 %41
113 store volatile i8 %iftmp.5.0.8, i8* null, align 1
120 declare noalias i8* @malloc() nounwind