[AArch64] Add a ldst-opt test with undef operands (NFC).

This patch adds a test to check that we do not use an undef renamable
register for renaming the other operand in a LDP instruction, as
suggested in D81108.
This commit is contained in:
Florian Hahn 2020-06-08 18:29:17 +01:00
parent 3610d31e7a
commit 22c2dc5931
1 changed files with 36 additions and 0 deletions

View File

@ -508,3 +508,39 @@ body: |
STURXi killed renamable $x8, $fp, -32 :: (store 8)
RET undef $lr
...
---
# Make sure we do not pick a register marked as undef for renaming.
#
# CHECK-LABEL: name: test15_undef_op
# CHECK: bb.0:
# CHECK-NEXT: liveins: $x0, $x1, $x8
# CHECK: undef renamable $x10, $x11 = LDPXi renamable $x0, 0 :: (load 8)
# CHECK-NEXT: renamable $x9 = LDRXui renamable $x0, 1 :: (load 8)
# CHECK-NEXT: STRXui renamable $x9, renamable $x0, 100 :: (store 8, align 4)
# CHECK-NEXT: renamable $x10 = ADDXrr $x10, $x10
# CHECK-NEXT: STPXi renamable $x10, killed $x11, renamable $x0, 10 :: (store 8, align 4)
# CHECK-NEXT: RET undef $lr
#
name: test15_undef_op
alignment: 4
tracksRegLiveness: true
liveins:
- { reg: '$x0' }
- { reg: '$x1' }
- { reg: '$x8' }
frameInfo:
maxAlignment: 1
maxCallFrameSize: 0
machineFunctionInfo: {}
body: |
bb.0:
liveins: $x0, $x1, $x8
renamable undef $x10, renamable $x9 = LDPXi renamable $x0, 0 :: (load 8)
STRXui renamable killed $x9, renamable $x0, 11 :: (store 8, align 4)
renamable $x9 = LDRXui renamable $x0, 1 :: (load 8)
STRXui renamable $x9, renamable $x0, 100 :: (store 8, align 4)
renamable $x10 = ADDXrr $x10, $x10
STRXui renamable $x10, renamable $x0, 10 :: (store 8, align 4)
RET undef $lr
...