Recommit r310809 with a fix for the spill problem
[llvm-core.git] / test / CodeGen / Thumb / machine-cse-physreg.mir
blob5206e89cf779e136e5b0e5d6c464ff1edab478e9
1 # RUN: llc -mtriple thumbv5e -run-pass=machine-cse -o - %s | FileCheck %s
3 # This is a contrived example made to expose a bug in
4 # MachineCSE, see PR32538.
6 # MachineCSE must not remove this def of %cpsr:
7 # CHECK-LABEL: bb.1:
8 # CHECK: , %cpsr = tLSLri
10 ...
11 ---
12 name:            spam
13 registers:
14   - { id: 0, class: tgpr }
15   - { id: 1, class: tgpr }
16   - { id: 2, class: tgpr }
17   - { id: 3, class: tgpr }
18 liveins:
19   - { reg: '%r0', virtual-reg: '%0' }
20 body:             |
21   bb.0:
22     liveins: %r0
23     %0 = COPY %r0
24     %1, %cpsr = tLSLri %0, 2, 14, _
25     tCMPi8 %0, 5, 14, _, implicit-def %cpsr
26     tBcc %bb.8, 8, %cpsr
28   bb.1:
29     %2, %cpsr = tLSLri %0, 2, 14, _
31   bb.8:
32     liveins: %cpsr
33     %3 = COPY %cpsr
34     tSTRi killed %3, %0, 0, 14, _
35 ...