File: postlegalizer-combiner-anyext-to-zext.mir

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (84 lines) | stat: -rw-r--r-- 2,907 bytes parent folder | download | duplicates (12)
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 -mtriple aarch64 -run-pass=aarch64-postlegalizer-combiner --aarch64postlegalizercombiner-only-enable-rule="mutate_anyext_to_zext" -verify-machineinstrs %s -o - | FileCheck %s
# REQUIRES: asserts

...
---
name:            scalar_icmp
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x0
    ; Scalars have 0 or 1, so we want a ZExt.

    ; CHECK-LABEL: name: scalar_icmp
    ; CHECK: liveins: $x0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %copy:_(s64) = COPY $x0
    ; CHECK-NEXT: %cst_1:_(s64) = G_CONSTANT i64 1
    ; CHECK-NEXT: %icmp:_(s32) = G_ICMP intpred(eq), %copy(s64), %cst_1
    ; CHECK-NEXT: %ext:_(s64) = G_ZEXT %icmp(s32)
    ; CHECK-NEXT: $x0 = COPY %ext(s64)
    ; CHECK-NEXT: RET_ReallyLR implicit $x0
    %copy:_(s64) = COPY $x0
    %cst_1:_(s64) = G_CONSTANT i64 1
    %icmp:_(s32) = G_ICMP intpred(eq), %copy(s64), %cst_1
    %ext:_(s64) = G_ANYEXT %icmp(s32)
    $x0 = COPY %ext(s64)
    RET_ReallyLR implicit $x0


...
---
name:            vector_icmp
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x0, $d0
    ; Vectors have 0 or negative 1, so we don't produce a zext.

    ; CHECK-LABEL: name: vector_icmp
    ; CHECK: liveins: $x0, $d0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %copy:_(<2 x s32>) = COPY $d0
    ; CHECK-NEXT: %cst_1:_(s32) = G_CONSTANT i32 1
    ; CHECK-NEXT: %vec_cst_1:_(<2 x s32>) = G_BUILD_VECTOR %cst_1(s32), %cst_1(s32)
    ; CHECK-NEXT: %icmp:_(<2 x s32>) = G_ICMP intpred(eq), %copy(<2 x s32>), %vec_cst_1
    ; CHECK-NEXT: %ext:_(<2 x s64>) = G_ANYEXT %icmp(<2 x s32>)
    ; CHECK-NEXT: $q0 = COPY %ext(<2 x s64>)
    ; CHECK-NEXT: RET_ReallyLR implicit $q0
    %copy:_(<2 x s32>) = COPY $d0
    %cst_1:_(s32) = G_CONSTANT i32 1
    %vec_cst_1:_(<2 x s32>) = G_BUILD_VECTOR %cst_1, %cst_1
    %icmp:_(<2 x s32>) = G_ICMP intpred(eq), %copy(<2 x s32>), %vec_cst_1
    %ext:_(<2 x s64>) = G_ANYEXT %icmp(<2 x s32>)
    $q0 = COPY %ext(<2 x s64>)
    RET_ReallyLR implicit $q0

...
---
name:            scalar_fcmp
legalized:       true
tracksRegLiveness: true
body:             |
  bb.0:
    liveins: $x0, $d0
    ; Scalars have 0 or 1, so we want a ZExt.

    ; CHECK-LABEL: name: scalar_fcmp
    ; CHECK: liveins: $x0, $d0
    ; CHECK-NEXT: {{  $}}
    ; CHECK-NEXT: %copy:_(s64) = COPY $d0
    ; CHECK-NEXT: %cst_1:_(s64) = G_FCONSTANT double 1.000000e+00
    ; CHECK-NEXT: %fcmp:_(s32) = G_FCMP intpred(eq), %copy(s64), %cst_1
    ; CHECK-NEXT: %ext:_(s64) = G_ZEXT %fcmp(s32)
    ; CHECK-NEXT: $x0 = COPY %ext(s64)
    ; CHECK-NEXT: RET_ReallyLR implicit $x0
    %copy:_(s64) = COPY $d0
    %cst_1:_(s64) = G_FCONSTANT double 1.0
    %fcmp:_(s32) = G_FCMP intpred(eq), %copy(s64), %cst_1
    %ext:_(s64) = G_ANYEXT %fcmp(s32)
    $x0 = COPY %ext(s64)
    RET_ReallyLR implicit $x0