File: legalizer-combiner-zext-trunc-crash.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 (67 lines) | stat: -rw-r--r-- 2,761 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
55
56
57
58
59
60
61
62
63
64
65
66
67
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple aarch64 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s

# This test checks we don't crash when doing zext(trunc) legalizer combines.
---
name:            zext_trunc_dead_inst_crash
alignment:       4
tracksRegLiveness: true
body:             |
  ; CHECK-LABEL: name: zext_trunc_dead_inst_crash
  ; CHECK: bb.0:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[DEF:%[0-9]+]]:_(s16) = G_IMPLICIT_DEF
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1:
  ; CHECK-NEXT:   successors: %bb.2(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[PHI:%[0-9]+]]:_(s16) = G_PHI %33(s16), %bb.2, [[DEF]](s16), %bb.0
  ; CHECK-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
  ; CHECK-NEXT:   [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[PHI]](s16)
  ; CHECK-NEXT:   [[AND:%[0-9]+]]:_(s32) = G_AND [[ANYEXT]], [[C]]
  ; CHECK-NEXT:   [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 46
  ; CHECK-NEXT:   [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[AND]](s32), [[C1]]
  ; CHECK-NEXT:   [[DEF1:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
  ; CHECK-NEXT:   [[OR:%[0-9]+]]:_(s32) = G_OR [[ICMP]], [[DEF1]]
  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:_(s32) = COPY [[ANYEXT]](s32)
  ; CHECK-NEXT:   [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 -33
  ; CHECK-NEXT:   [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C2]]
  ; CHECK-NEXT:   [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 -65
  ; CHECK-NEXT:   [[ADD:%[0-9]+]]:_(s32) = G_ADD [[AND1]], [[C3]]
  ; CHECK-NEXT:   [[AND2:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]]
  ; CHECK-NEXT:   [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 26
  ; CHECK-NEXT:   [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND2]](s32), [[C4]]
  ; CHECK-NEXT:   [[OR1:%[0-9]+]]:_(s32) = G_OR [[ICMP1]], [[OR]]
  ; CHECK-NEXT:   [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
  ; CHECK-NEXT:   [[AND3:%[0-9]+]]:_(s32) = G_AND [[OR1]], [[C5]]
  ; CHECK-NEXT:   G_BRCOND [[AND3]](s32), %bb.2
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2:
  ; CHECK-NEXT:   successors: %bb.1(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[C6:%[0-9]+]]:_(s16) = G_CONSTANT i16 64
  ; CHECK-NEXT:   G_BR %bb.1
  bb.1:
    %1:_(s8) = G_CONSTANT i8 46
    %3:_(s1) = G_IMPLICIT_DEF
    %5:_(s8) = G_CONSTANT i8 -33
    %7:_(s8) = G_CONSTANT i8 -65
    %9:_(s8) = G_CONSTANT i8 26
    %13:_(s8) = G_IMPLICIT_DEF

  bb.2:
    %0:_(s8) = G_PHI %12(s8), %bb.4, %13(s8), %bb.1
    %2:_(s1) = G_ICMP intpred(eq), %0(s8), %1
    %4:_(s1) = G_OR %2, %3
    %6:_(s8) = G_AND %0, %5
    %8:_(s8) = G_ADD %6, %7
    %10:_(s1) = G_ICMP intpred(ult), %8(s8), %9
    %11:_(s1) = G_OR %10, %4
    G_BRCOND %11(s1), %bb.4

  bb.4:
    %12:_(s8) = G_CONSTANT i8 64
    G_BR %bb.2

...