• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=thumbv6-unknown-linux-gnu | FileCheck %s
3
4%umul.ty = type { i32, i1 }
5
6define i32 @test1(i32 %a, i1 %x) nounwind {
7; CHECK-LABEL: test1:
8; CHECK:       @ %bb.0:
9; CHECK-NEXT:    push {r4, r5, r7, lr}
10; CHECK-NEXT:    mov r5, r1
11; CHECK-NEXT:    movs r2, #37
12; CHECK-NEXT:    movs r4, #0
13; CHECK-NEXT:    mov r1, r4
14; CHECK-NEXT:    mov r3, r4
15; CHECK-NEXT:    bl __muldi3
16; CHECK-NEXT:    lsls r1, r5, #31
17; CHECK-NEXT:    beq .LBB0_2
18; CHECK-NEXT:  @ %bb.1:
19; CHECK-NEXT:    mvns r0, r4
20; CHECK-NEXT:  .LBB0_2:
21; CHECK-NEXT:    pop {r4, r5, r7, pc}
22  %tmp0 = tail call %umul.ty @llvm.umul.with.overflow.i32(i32 %a, i32 37)
23  %tmp1 = extractvalue %umul.ty %tmp0, 0
24  %tmp2 = select i1 %x, i32 -1, i32 %tmp1
25  ret i32 %tmp2
26}
27
28declare %umul.ty @llvm.umul.with.overflow.i32(i32, i32) nounwind readnone
29
30define i32 @test2(i32* %m_degree) ssp {
31; CHECK-LABEL: test2:
32; CHECK:       @ %bb.0:
33; CHECK-NEXT:    push {r4, lr}
34; CHECK-NEXT:    movs r1, #7
35; CHECK-NEXT:    lsls r1, r1, #29
36; CHECK-NEXT:    ldr r0, [r0]
37; CHECK-NEXT:    mov r2, r0
38; CHECK-NEXT:    bics r2, r1
39; CHECK-NEXT:    subs r1, r0, r2
40; CHECK-NEXT:    subs r2, r1, #1
41; CHECK-NEXT:    sbcs r1, r2
42; CHECK-NEXT:    movs r4, #0
43; CHECK-NEXT:    cmp r1, #0
44; CHECK-NEXT:    bne .LBB1_2
45; CHECK-NEXT:  @ %bb.1:
46; CHECK-NEXT:    lsls r0, r0, #3
47; CHECK-NEXT:    b .LBB1_3
48; CHECK-NEXT:  .LBB1_2:
49; CHECK-NEXT:    mvns r0, r4
50; CHECK-NEXT:  .LBB1_3:
51; CHECK-NEXT:    bl _Znam
52; CHECK-NEXT:    mov r0, r4
53; CHECK-NEXT:    pop {r4, pc}
54%val = load i32, i32* %m_degree, align 4
55%res = call %umul.ty @llvm.umul.with.overflow.i32(i32 %val, i32 8)
56%ov = extractvalue %umul.ty %res, 1
57%mul = extractvalue %umul.ty %res, 0
58%sel = select i1 %ov, i32 -1, i32 %mul
59%ret = call noalias i8* @_Znam(i32 %sel)
60ret i32 0
61}
62
63declare noalias i8* @_Znam(i32)
64