1 # RUN: llc -mtriple thumbv6m-arm-none-eabi -run-pass=machine-cse -verify-machineinstrs -o - %s | FileCheck %s
4 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
5 target triple = "thumbv6m-arm-none-eabi"
7 define i32 @funca(i64 %l1) {
9 %l2 = icmp ult i64 %l1, -177673816660004267
10 %l3 = add i64 %l1, 401100203
11 %rem.i = select i1 %l2, i64 %l1, i64 %l3
12 %conv = trunc i64 %rem.i to i32
16 define i32 @funcb(i64 %l1) { ret i32 0 }
21 tracksRegLiveness: true
23 - { reg: '$r0', virtual-reg: '%0' }
24 - { reg: '$r1', virtual-reg: '%1' }
29 isTargetSpecific: false
33 isTargetSpecific: false
36 successors: %bb.1(0x40000000), %bb.2(0x40000000)
41 %2:tgpr = tLDRpci %const.0, 14, $noreg :: (load 4 from constant-pool)
42 %3:tgpr, dead $cpsr = tADDrr %0, %2, 14, $noreg
43 %4:tgpr = tLDRpci %const.1, 14, $noreg :: (load 4 from constant-pool)
44 %5:tgpr, $cpsr = tADDrr %0, %2, 14, $noreg
45 %6:tgpr, $cpsr = tADC %1, killed %4, 14, $noreg, implicit $cpsr
49 successors: %bb.2(0x80000000)
52 %7:tgpr = PHI %3, %bb.1, %0, %bb.0
54 tBX_RET 14, $noreg, implicit $r0
56 # CHECK-LABEL: name: funca
57 # cpsr def must not be dead
58 # CHECK: %3:tgpr, $cpsr = tADDrr %0, %2
59 # CHECK-NOT: %5:tgpr, $cpsr = tADDrr %0, %2
64 tracksRegLiveness: true
66 - { reg: '$r0', virtual-reg: '%0' }
67 - { reg: '$r1', virtual-reg: '%1' }
72 isTargetSpecific: false
76 isTargetSpecific: false
79 successors: %bb.1(0x40000000), %bb.2(0x40000000)
84 %2:tgpr = tLDRpci %const.0, 14, $noreg :: (load 4 from constant-pool)
85 %3:tgpr, dead $cpsr = tADDrr %0, %2, 14, $noreg
86 %4:tgpr = tLDRpci %const.1, 14, $noreg :: (load 4 from constant-pool)
87 %5:tgpr, dead $cpsr = tADDrr %0, %2, 14, $noreg
88 %6:tgpr, $cpsr = tADDrr %1, killed %4, 14, $noreg
92 successors: %bb.2(0x80000000)
95 %7:tgpr = PHI %3, %bb.1, %0, %bb.0
97 tBX_RET 14, $noreg, implicit $r0
99 # CHECK-LABEL: name: funcb
100 # cpsr def should be dead
101 # CHECK: %3:tgpr, dead $cpsr = tADDrr %0, %2
102 # CHECK-NOT: %5:tgpr, dead $cpsr = tADDrr %0, %2