• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -mtriple thumbv6m-arm-none-eabi -run-pass=machine-cse -verify-machineinstrs -o - %s | FileCheck %s
2
3--- |
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"
6
7  define i32 @funca(i64 %l1) {
8  entry:
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
13    ret i32 %conv
14  }
15
16  define i32 @funcb(i64 %l1) { ret i32 0 }
17
18...
19---
20name:            funca
21tracksRegLiveness: true
22liveins:
23  - { reg: '$r0', virtual-reg: '%0' }
24  - { reg: '$r1', virtual-reg: '%1' }
25constants:
26  - id:              0
27    value:           i32 401100203
28    alignment:       4
29    isTargetSpecific: false
30  - id:              1
31    value:           i32 41367909
32    alignment:       4
33    isTargetSpecific: false
34body:             |
35  bb.0.entry:
36    successors: %bb.1(0x40000000), %bb.2(0x40000000)
37    liveins: $r0, $r1
38
39    %1:tgpr = COPY $r1
40    %0:tgpr = COPY $r0
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
46    tBcc %bb.2, 3, $cpsr
47
48  bb.1.entry:
49    successors: %bb.2(0x80000000)
50
51  bb.2.entry:
52    %7:tgpr = PHI %3, %bb.1, %0, %bb.0
53    $r0 = COPY %7
54    tBX_RET 14, $noreg, implicit $r0
55
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
60
61...
62---
63name:            funcb
64tracksRegLiveness: true
65liveins:
66  - { reg: '$r0', virtual-reg: '%0' }
67  - { reg: '$r1', virtual-reg: '%1' }
68constants:
69  - id:              0
70    value:           i32 401100203
71    alignment:       4
72    isTargetSpecific: false
73  - id:              1
74    value:           i32 41367909
75    alignment:       4
76    isTargetSpecific: false
77body:             |
78  bb.0:
79    successors: %bb.1(0x40000000), %bb.2(0x40000000)
80    liveins: $r0, $r1
81
82    %1:tgpr = COPY $r1
83    %0:tgpr = COPY $r0
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
89    tBcc %bb.2, 3, $cpsr
90
91  bb.1:
92    successors: %bb.2(0x80000000)
93
94  bb.2:
95    %7:tgpr = PHI %3, %bb.1, %0, %bb.0
96    $r0 = COPY %7
97    tBX_RET 14, $noreg, implicit $r0
98
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
103...
104