1 # RUN: llc -mtriple thumbv6m-arm-none-eabi -run-pass=machine-cse -verify-machineinstrs -o - %s | FileCheck %s
2 # RUN: llc -mtriple thumbv6m-arm-none-eabi -passes=machine-cse -o - %s | FileCheck %s
5 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
6 target triple = "thumbv6m-arm-none-eabi"
8 define i32 @funca(i64 %l1) {
10 %l2 = icmp ult i64 %l1, -177673816660004267
11 %l3 = add i64 %l1, 401100203
12 %rem.i = select i1 %l2, i64 %l1, i64 %l3
13 %conv = trunc i64 %rem.i to i32
17 define i32 @funcb(i64 %l1) { ret i32 0 }
22 tracksRegLiveness: true
24 - { reg: '$r0', virtual-reg: '%0' }
25 - { reg: '$r1', virtual-reg: '%1' }
30 isTargetSpecific: false
34 isTargetSpecific: false
37 successors: %bb.1(0x40000000), %bb.2(0x40000000)
42 %2:tgpr = tLDRpci %const.0, 14, $noreg :: (load (s32) from constant-pool)
43 %3:tgpr, dead $cpsr = tADDrr %0, %2, 14, $noreg
44 %4:tgpr = tLDRpci %const.1, 14, $noreg :: (load (s32) from constant-pool)
45 %5:tgpr, $cpsr = tADDrr %0, %2, 14, $noreg
46 %6:tgpr, $cpsr = tADC %1, killed %4, 14, $noreg, implicit $cpsr
50 successors: %bb.2(0x80000000)
53 %7:tgpr = PHI %3, %bb.1, %0, %bb.0
55 tBX_RET 14, $noreg, implicit $r0
57 # CHECK-LABEL: name: funca
58 # cpsr def must not be dead
59 # CHECK: %3:tgpr, $cpsr = tADDrr %0, %2
60 # CHECK-NOT: %5:tgpr, $cpsr = tADDrr %0, %2
65 tracksRegLiveness: true
67 - { reg: '$r0', virtual-reg: '%0' }
68 - { reg: '$r1', virtual-reg: '%1' }
73 isTargetSpecific: false
77 isTargetSpecific: false
80 successors: %bb.1(0x40000000), %bb.2(0x40000000)
85 %2:tgpr = tLDRpci %const.0, 14, $noreg :: (load (s32) from constant-pool)
86 %3:tgpr, dead $cpsr = tADDrr %0, %2, 14, $noreg
87 %4:tgpr = tLDRpci %const.1, 14, $noreg :: (load (s32) from constant-pool)
88 %5:tgpr, dead $cpsr = tADDrr %0, %2, 14, $noreg
89 %6:tgpr, $cpsr = tADDrr %1, killed %4, 14, $noreg
93 successors: %bb.2(0x80000000)
96 %7:tgpr = PHI %3, %bb.1, %0, %bb.0
98 tBX_RET 14, $noreg, implicit $r0
100 # CHECK-LABEL: name: funcb
101 # cpsr def should be dead
102 # CHECK: %3:tgpr, dead $cpsr = tADDrr %0, %2
103 # CHECK-NOT: %5:tgpr, dead $cpsr = tADDrr %0, %2