File: prelegalizer-combiner-divrem-insertpt-conflict.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 (79 lines) | stat: -rw-r--r-- 3,038 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
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple aarch64 -run-pass=aarch64-prelegalizer-combiner -global-isel -verify-machineinstrs %s -o - | FileCheck %s

---
name:            test
alignment:       4
tracksRegLiveness: true
body:             |
  bb.1:
    ; CHECK-LABEL: name: test
    ; CHECK: [[C:%[0-9]+]]:_(s1) = G_CONSTANT i1 true
    ; CHECK-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[C]](s1)
    ; CHECK-NEXT: [[SEXT1:%[0-9]+]]:_(s32) = G_SEXT [[C]](s1)
    ; CHECK-NEXT: [[UDIVREM:%[0-9]+]]:_(s32), [[UDIVREM1:%[0-9]+]]:_ = G_UDIVREM [[SEXT]], [[SEXT1]]
    ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[UDIVREM1]](s32)
    ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[UDIVREM]](s32)
    ; CHECK-NEXT: [[SEXT2:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s8)
    ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[ZEXT]], [[SEXT2]]
    ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[OR]](s64)
    ; CHECK-NEXT: $w0 = COPY [[TRUNC1]](s32)
    ; CHECK-NEXT: RET_ReallyLR implicit $w0
    %0:_(s16) = G_CONSTANT i16 0
    %2:_(s1) = G_CONSTANT i1 true
    %1:_(s1) = G_ICMP intpred(sge), %0(s16), %0
    %3:_(s8) = G_SEXT %2(s1)
    %4:_(s32) = G_SEXT %3(s8)
    %5:_(s32) = G_SEXT %1(s1)
    %6:_(s32) = G_UDIV %4, %5
    %7:_(s32) = COPY %5(s32)
    %8:_(s32) = G_SEXT %2(s1)
    %9:_(s32) = G_UREM %7, %8
    %10:_(s8) = G_TRUNC %9(s32)
    %11:_(s64) = G_ZEXT %6(s32)
    %12:_(s64) = G_SEXT %10(s8)
    %13:_(s64) = G_OR %11, %12
    %14:_(s32) = G_TRUNC %13(s64)
    $w0 = COPY %14(s32)
    RET_ReallyLR implicit $w0

...

# Check with the div and rem the other way around
---
name:            test_inverted_div_rem
alignment:       4
tracksRegLiveness: true
body:             |
  bb.1:
    ; CHECK-LABEL: name: test_inverted_div_rem
    ; CHECK: [[C:%[0-9]+]]:_(s1) = G_CONSTANT i1 true
    ; CHECK-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[C]](s1)
    ; CHECK-NEXT: [[SEXT1:%[0-9]+]]:_(s32) = G_SEXT [[C]](s1)
    ; CHECK-NEXT: [[UDIVREM:%[0-9]+]]:_(s32), [[UDIVREM1:%[0-9]+]]:_ = G_UDIVREM [[SEXT]], [[SEXT1]]
    ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[UDIVREM]](s32)
    ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[UDIVREM1]](s32)
    ; CHECK-NEXT: [[SEXT2:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s8)
    ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[ZEXT]], [[SEXT2]]
    ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[OR]](s64)
    ; CHECK-NEXT: $w0 = COPY [[TRUNC1]](s32)
    ; CHECK-NEXT: RET_ReallyLR implicit $w0
    %0:_(s16) = G_CONSTANT i16 0
    %2:_(s1) = G_CONSTANT i1 true
    %1:_(s1) = G_ICMP intpred(sge), %0(s16), %0
    %3:_(s8) = G_SEXT %2(s1)
    %4:_(s32) = G_SEXT %3(s8)
    %5:_(s32) = G_SEXT %1(s1)
    %6:_(s32) = G_UREM %4, %5
    %7:_(s32) = COPY %5(s32)
    %8:_(s32) = G_SEXT %2(s1)
    %9:_(s32) = G_UDIV %7, %8
    %10:_(s8) = G_TRUNC %9(s32)
    %11:_(s64) = G_ZEXT %6(s32)
    %12:_(s64) = G_SEXT %10(s8)
    %13:_(s64) = G_OR %11, %12
    %14:_(s32) = G_TRUNC %13(s64)
    $w0 = COPY %14(s32)
    RET_ReallyLR implicit $w0

...