File: postlegalizer-combiner-redundant-sextinreg.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 (83 lines) | stat: -rw-r--r-- 2,580 bytes parent folder | download | duplicates (16)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple aarch64 -run-pass=aarch64-postlegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s

...
---
name:            sextload
legalized:       true
tracksRegLiveness: true
body: |
  bb.0.entry:
    liveins: $x0

    ; CHECK-LABEL: name: sextload
    ; CHECK: liveins: $x0
    ; CHECK: %x0:_(p0) = COPY $x0
    ; CHECK: %sextload:_(s32) = G_SEXTLOAD %x0(p0) :: (load (s16))
    ; CHECK: $w0 = COPY %sextload(s32)
    %x0:_(p0) = COPY $x0
    %sextload:_(s32) = G_SEXTLOAD %x0:_(p0) :: (load (s16))
    %sext_inreg:_(s32) = G_SEXT_INREG %sextload:_(s32), 24
    $w0 = COPY %sext_inreg(s32)
...
---
name:            assert_sext
legalized:       true
tracksRegLiveness: true
body: |
  bb.0.entry:
    liveins: $w0
    ; The G_ASSERT_SEXT says we already sign extended from 24 bits, so the
    ; G_SEXT_INREG is not necessary.

    ; CHECK-LABEL: name: assert_sext
    ; CHECK: liveins: $w0
    ; CHECK: %w0:_(s32) = COPY $w0
    ; CHECK: %assert_sext:_(s32) = G_ASSERT_SEXT %w0, 24
    ; CHECK: $w0 = COPY %assert_sext(s32)
    %w0:_(s32) = COPY $w0
    %assert_sext:_(s32) = G_ASSERT_SEXT %w0, 24
    %sext_inreg:_(s32) = G_SEXT_INREG %assert_sext:_(s32), 24
    $w0 = COPY %sext_inreg(s32)
...
---
name:            assert_sext_greater_width
legalized:       true
tracksRegLiveness: true
body: |
  bb.0.entry:
    liveins: $w0
    ; The G_ASSERT_SEXT is from a wider width than the G_SEXT_INREG, so we
    ; can't eliminate it.

    ; CHECK-LABEL: name: assert_sext_greater_width
    ; CHECK: liveins: $w0
    ; CHECK: %w0:_(s32) = COPY $w0
    ; CHECK: %assert_sext:_(s32) = G_ASSERT_SEXT %w0, 24
    ; CHECK: %sext_inreg:_(s32) = G_SEXT_INREG %assert_sext, 12
    ; CHECK: $w0 = COPY %sext_inreg(s32)
    %w0:_(s32) = COPY $w0
    %assert_sext:_(s32) = G_ASSERT_SEXT %w0, 24
    %sext_inreg:_(s32) = G_SEXT_INREG %assert_sext:_(s32), 12
    $w0 = COPY %sext_inreg(s32)
...
---
name:            assert_sext_smaller_width
legalized:       true
tracksRegLiveness: true
body: |
  bb.0.entry:
    liveins: $w0
    ; The G_ASSERT_SEXT is from a smaller width, so the G_SEXT_INREG is not
    ; necessary.

    ; CHECK-LABEL: name: assert_sext_smaller_width
    ; CHECK: liveins: $w0
    ; CHECK: %w0:_(s32) = COPY $w0
    ; CHECK: %assert_sext:_(s32) = G_ASSERT_SEXT %w0, 8
    ; CHECK: $w0 = COPY %assert_sext(s32)
    %w0:_(s32) = COPY $w0
    %assert_sext:_(s32) = G_ASSERT_SEXT %w0, 8
    %sext_inreg:_(s32) = G_SEXT_INREG %assert_sext:_(s32), 12
    $w0 = COPY %sext_inreg(s32)
...