1 # RUN: llc -mtriple=thumbv8 -run-pass=peephole-opt %s -o - | FileCheck %s
3 # Test case for PR 47980:
4 # Ensure that peephole optimization to fold move immediate doesn't unconstrain
5 # the register class of the consumer.
7 # Check that register class for %5 is unchanged as 'tcgpr'
8 # CHECK: { id: 5, class: tcgpr, preferred-register: '' }
9 # CHECK: TCRETURNri killed %5
12 define i32 @foo(i32 %in) {
19 - { id: 0, class: gpr}
20 - { id: 1, class: gpr }
21 - { id: 2, class: rgpr }
22 - { id: 3, class: gpr }
23 - { id: 4, class: rgpr }
24 - { id: 5, class: tcgpr }
26 - { reg: '$r0', virtual-reg: '%0' }
27 - { reg: '$r1', virtual-reg: '%1' }
28 - { reg: '$r2', virtual-reg: '%2' }
29 - { reg: '$r3', virtual-reg: '%3' }
32 liveins: $r0, $r1, $r2, $r3
38 %4 = t2MOVi32imm 270337
39 %5 = t2ADDrr killed %2, killed %4, 14, $noreg, $noreg
44 TCRETURNri killed %5, 0, implicit $sp, implicit $r0, implicit $r1, implicit $r2, implicit $r3