File: legalize-constant.mir

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (84 lines) | stat: -rw-r--r-- 2,358 bytes parent folder | download | duplicates (2)
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
84
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -O0 -run-pass=legalizer %s -o - | FileCheck %s

--- |
  target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
  target triple = "aarch64--"
  define void @test_constant() {
  entry:
    ret void
  }
  define void @test_fconstant() {
  entry:
    ret void
  }
...

---
name:            test_constant
registers:
  - { id: 0, class: _ }
  - { id: 1, class: _ }
  - { id: 2, class: _ }
  - { id: 3, class: _ }
  - { id: 4, class: _ }
  - { id: 5, class: _ }
body: |
  bb.0.entry:

    ; CHECK-LABEL: name: test_constant
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
    ; CHECK: $w0 = COPY [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 42
    ; CHECK: $w0 = COPY [[C1]](s32)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1
    ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY [[C2]](s32)
    ; CHECK: $w0 = COPY [[COPY]](s32)
    ; CHECK: $w0 = COPY [[C2]](s32)
    ; CHECK: [[C3:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
    ; CHECK: $x0 = COPY [[C3]](s64)
    ; CHECK: [[C4:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
    ; CHECK: $x0 = COPY [[C4]](s64)
    %0(s1) = G_CONSTANT i1 0
    %6:_(s32) = G_ANYEXT %0
    $w0 = COPY %6
    %1(s8) = G_CONSTANT i8 42
    %7:_(s32) = G_ANYEXT %1
    $w0 = COPY %7
    %2(s16) = G_CONSTANT i16 65535
    %8:_(s32) = G_ANYEXT %2
    $w0 = COPY %8
    %3(s32) = G_CONSTANT i32 -1
    $w0 = COPY %3
    %4(s64) = G_CONSTANT i64 1
    $x0 = COPY %4
    %5(s64) = G_CONSTANT i64 0
    $x0 = COPY %5
...

---
name:            test_fconstant
registers:
  - { id: 0, class: _ }
  - { id: 1, class: _ }
  - { id: 2, class: _ }
body: |
  bb.0.entry:

    ; CHECK-LABEL: name: test_fconstant
    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 1.000000e+00
    ; CHECK: $w0 = COPY [[C]](s32)
    ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_FCONSTANT double 2.000000e+00
    ; CHECK: $x0 = COPY [[C1]](s64)
    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_FCONSTANT float 0.000000e+00
    ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[C2]](s32)
    ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[FPTRUNC]](s16)
    ; CHECK: $w0 = COPY [[ANYEXT]](s32)
    %0(s32) = G_FCONSTANT float 1.0
    $w0 = COPY %0
    %1(s64) = G_FCONSTANT double 2.0
    $x0 = COPY %1
    %2(s16) = G_FCONSTANT half 0.0
    %3:_(s32) = G_ANYEXT %2
    $w0 = COPY %3
...