File: stp-opt-with-renaming-undef-assert.mir

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (54 lines) | stat: -rw-r--r-- 2,537 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# RUN: llc -run-pass=aarch64-ldst-opt -mtriple=aarch64 -verify-machineinstrs -o - %s | FileCheck %s

# This test checks that aarch64 load store optimizer is not throwing an
# assertion:
# "Rename register used between paired instruction, trashing the content".
#
# The assertion was previously triggered because q16 is picked as renamable
# register, which overlap with renamable undef d16 used by ZIP2 instruction.
# However, the content of an undef register is not used in meaningful way,
# aarch64 load store optimizer should not throw an assertion if a renamable
# register picked overlap with a renamable undef register.

# This test also checks that pairwise store STP is generated.

# CHECK-LABLE: test
# CHECK: bb.0:
# CHECK-NEXT: liveins: $x0, $x17, $x18
# CHECK: renamable $q13_q14_q15 = LD3Threev16b undef renamable $x17 :: (load (s384) from `ptr undef`, align 64)
# CHECK-NEXT: renamable $q23_q24_q25 = LD3Threev16b undef renamable $x18 :: (load (s384) from `ptr undef`, align 64)
# CHECK-NEXT: $q16 = EXTv16i8 renamable $q23, renamable $q23, 8
# CHECK-NEXT: renamable $q20 = EXTv16i8 renamable $q14, renamable $q14, 8
# CHECK-NEXT: STRQui killed renamable $q20, $sp, 4 :: (store (s128))
# CHECK-NEXT: renamable $d6 = ZIP2v8i8 renamable $d23, undef renamable $d16
# CHECK-NEXT: STRDui killed renamable $d6, $sp, 11 :: (store (s64))
# CHECK-NEXT: renamable $q6 = EXTv16i8 renamable $q13, renamable $q13, 8
# CHECK-NEXT: STPQi killed renamable $q6, killed $q16, $sp, 6 :: (store (s128))
# CHECK-NEXT: RET undef $lr

---
name:            test
alignment:       4
tracksRegLiveness: true
liveins:
  - { reg: '$x0', virtual-reg: '' }
frameInfo:
  maxAlignment:    16
  maxCallFrameSize: 0
fixedStack:      []
machineFunctionInfo: {}
body:             |
  bb.0:
    liveins: $x0, $x17, $x18
    renamable $q13_q14_q15 = LD3Threev16b undef renamable $x17 :: (load (s384) from `<16 x i8>* undef`, align 64)
    renamable $q23_q24_q25 = LD3Threev16b undef renamable $x18 :: (load (s384) from `<16 x i8>* undef`, align 64)
    renamable $q20 = EXTv16i8 renamable $q23, renamable $q23, 8
    STRQui killed renamable $q20, $sp, 7 :: (store (s128))
    renamable $q20 = EXTv16i8 renamable $q14, renamable $q14, 8
    STRQui killed renamable $q20, $sp, 4 :: (store (s128))
    renamable $d6 = ZIP2v8i8 renamable $d23, undef renamable $d16
    STRDui killed renamable $d6, $sp, 11 :: (store (s64))
    renamable $q6 = EXTv16i8 renamable $q13, renamable $q13, 8
    STRQui killed renamable $q6, $sp, 6 :: (store (s128))
    RET undef $lr
...