forked from OSchip/llvm-project
210 lines
6.2 KiB
YAML
210 lines
6.2 KiB
YAML
# 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_simple() {
|
|
entry:
|
|
ret void
|
|
next:
|
|
ret void
|
|
}
|
|
define void @bitcast128() {
|
|
ret void
|
|
}
|
|
define void @testExtOfCopyOfTrunc() {
|
|
ret void
|
|
}
|
|
define void @testExtOf2CopyOfTrunc() {
|
|
ret void
|
|
}
|
|
...
|
|
|
|
---
|
|
name: test_simple
|
|
registers:
|
|
- { id: 0, class: _ }
|
|
- { id: 1, class: _ }
|
|
- { id: 2, class: _ }
|
|
- { id: 3, class: _ }
|
|
- { id: 4, class: _ }
|
|
- { id: 5, class: _ }
|
|
- { id: 6, class: _ }
|
|
- { id: 7, class: _ }
|
|
- { id: 8, class: _ }
|
|
- { id: 9, class: _ }
|
|
- { id: 10, class: _ }
|
|
- { id: 11, class: _ }
|
|
- { id: 12, class: _ }
|
|
- { id: 13, class: _ }
|
|
- { id: 14, class: _ }
|
|
- { id: 15, class: _ }
|
|
- { id: 16, class: _ }
|
|
body: |
|
|
; CHECK-LABEL: name: test_simple
|
|
; CHECK: bb.0.{{[a-zA-Z0-9]+}}:
|
|
; CHECK: successors: %bb.1(0x80000000)
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
|
|
; CHECK: [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[COPY]](s64)
|
|
; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
|
|
; CHECK: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[COPY]](s64)
|
|
; CHECK: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT [[INTTOPTR]](p0)
|
|
; CHECK: $x0 = COPY [[PTRTOINT]](s64)
|
|
; CHECK: G_BRCOND [[TRUNC]](s1), %bb.1
|
|
; CHECK: bb.1.{{[a-zA-Z0-9]+}}:
|
|
; CHECK: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
|
|
; CHECK: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
|
|
; CHECK: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC]](s1), [[TRUNC2]], [[TRUNC3]]
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
|
|
; CHECK: $w0 = COPY [[COPY1]](s32)
|
|
; CHECK: [[TRUNC4:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
|
|
; CHECK: [[TRUNC5:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
|
|
; CHECK: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC]](s1), [[TRUNC4]], [[TRUNC5]]
|
|
; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SELECT1]](s32)
|
|
; CHECK: $w0 = COPY [[COPY2]](s32)
|
|
; CHECK: [[TRUNC6:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
|
|
; CHECK: [[TRUNC7:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
|
|
; CHECK: [[SELECT2:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC]](s1), [[TRUNC6]], [[TRUNC7]]
|
|
; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[SELECT2]](s32)
|
|
; CHECK: $w0 = COPY [[COPY3]](s32)
|
|
; CHECK: [[SELECT3:%[0-9]+]]:_(s32) = G_SELECT [[TRUNC]](s1), [[TRUNC1]], [[TRUNC1]]
|
|
; CHECK: [[SELECT4:%[0-9]+]]:_(s64) = G_SELECT [[TRUNC]](s1), [[COPY]], [[COPY]]
|
|
; CHECK: $x0 = COPY [[SELECT4]](s64)
|
|
; CHECK: [[BITCAST:%[0-9]+]]:_(<2 x s32>) = G_BITCAST [[COPY]](s64)
|
|
; CHECK: [[BITCAST1:%[0-9]+]]:_(s64) = G_BITCAST [[BITCAST]](<2 x s32>)
|
|
; CHECK: $x0 = COPY [[BITCAST1]](s64)
|
|
; CHECK: [[BITCAST2:%[0-9]+]]:_(s32) = G_BITCAST [[SELECT3]](s32)
|
|
; CHECK: $w0 = COPY [[BITCAST2]](s32)
|
|
; CHECK: [[BITCAST3:%[0-9]+]]:_(<4 x s8>) = G_BITCAST [[COPY]](s64)
|
|
; CHECK: [[BITCAST4:%[0-9]+]]:_(s32) = G_BITCAST [[BITCAST3]](<4 x s8>)
|
|
; CHECK: $w0 = COPY [[BITCAST4]](s32)
|
|
; CHECK: [[BITCAST5:%[0-9]+]]:_(<2 x s16>) = G_BITCAST [[COPY]](s64)
|
|
; CHECK: [[BITCAST6:%[0-9]+]]:_(s32) = G_BITCAST [[BITCAST5]](<2 x s16>)
|
|
; CHECK: $w0 = COPY [[BITCAST6]](s32)
|
|
bb.0.entry:
|
|
liveins: $x0, $x1, $x2, $x3
|
|
%0(s64) = COPY $x0
|
|
|
|
%1(s1) = G_TRUNC %0
|
|
%2(s8) = G_TRUNC %0
|
|
%3(s16) = G_TRUNC %0
|
|
%4(s32) = G_TRUNC %0
|
|
|
|
%5(p0) = G_INTTOPTR %0
|
|
%6(s64) = G_PTRTOINT %5
|
|
$x0 = COPY %6
|
|
|
|
G_BRCOND %1, %bb.1
|
|
|
|
bb.1.next:
|
|
|
|
%7(s1) = G_SELECT %1, %1, %1
|
|
%21:_(s32) = G_ANYEXT %7
|
|
$w0 = COPY %21
|
|
|
|
%8(s8) = G_SELECT %1, %2, %2
|
|
%20:_(s32) = G_ANYEXT %8
|
|
$w0 = COPY %20
|
|
|
|
%9(s16) = G_SELECT %1, %3, %3
|
|
%19:_(s32) = G_ANYEXT %9
|
|
$w0 = COPY %19
|
|
|
|
%10(s32) = G_SELECT %1, %4, %4
|
|
%11(s64) = G_SELECT %1, %0, %0
|
|
$x0 = COPY %11
|
|
|
|
%12(<2 x s32>) = G_BITCAST %0
|
|
%13(s64) = G_BITCAST %12
|
|
$x0 = COPY %13
|
|
%14(s32) = G_BITCAST %10
|
|
$w0 = COPY %14
|
|
%15(<4 x s8>) = G_BITCAST %0
|
|
%17:_(s32) = G_BITCAST %15
|
|
$w0 = COPY %17
|
|
%16(<2 x s16>) = G_BITCAST %0
|
|
%18:_(s32) = G_BITCAST %16
|
|
$w0 = COPY %18
|
|
...
|
|
|
|
---
|
|
name: bitcast128
|
|
tracksRegLiveness: true
|
|
registers:
|
|
- { id: 0, class: _}
|
|
- { id: 1, class: _}
|
|
- { id: 2, class: _}
|
|
- { id: 3, class: _}
|
|
body: |
|
|
bb.1:
|
|
liveins: $x0, $x1
|
|
; This is legal and shouldn't be changed.
|
|
; CHECK-LABEL: name: bitcast128
|
|
; CHECK: liveins: $x0, $x1
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
|
|
; CHECK: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[COPY]](s64), [[COPY1]](s64)
|
|
; CHECK: [[BITCAST:%[0-9]+]]:_(<2 x s64>) = G_BITCAST [[MV]](s128)
|
|
; CHECK: $q0 = COPY [[BITCAST]](<2 x s64>)
|
|
; CHECK: RET_ReallyLR implicit $q0
|
|
%0(s64) = COPY $x0
|
|
%1(s64) = COPY $x1
|
|
%3(s128) = G_MERGE_VALUES %0(s64), %1(s64)
|
|
%2(<2 x s64>) = G_BITCAST %3(s128)
|
|
$q0 = COPY %2(<2 x s64>)
|
|
RET_ReallyLR implicit $q0
|
|
|
|
...
|
|
---
|
|
name: testExtOfCopyOfTrunc
|
|
tracksRegLiveness: true
|
|
registers:
|
|
- { id: 0, class: _}
|
|
- { id: 1, class: _}
|
|
- { id: 2, class: _}
|
|
- { id: 3, class: _}
|
|
body: |
|
|
bb.1:
|
|
liveins: $x0
|
|
; CHECK-LABEL: name: testExtOfCopyOfTrunc
|
|
; CHECK: liveins: $x0
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[COPY]](s64)
|
|
; CHECK: $x0 = COPY [[COPY1]](s64)
|
|
; CHECK: RET_ReallyLR implicit $x0
|
|
%0(s64) = COPY $x0
|
|
%1(s1) = G_TRUNC %0
|
|
%2(s1) = COPY %1
|
|
%3(s64) = G_ANYEXT %2
|
|
$x0 = COPY %3
|
|
RET_ReallyLR implicit $x0
|
|
|
|
...
|
|
---
|
|
name: testExtOf2CopyOfTrunc
|
|
tracksRegLiveness: true
|
|
registers:
|
|
- { id: 0, class: _}
|
|
- { id: 1, class: _}
|
|
- { id: 2, class: _}
|
|
- { id: 3, class: _}
|
|
body: |
|
|
bb.1:
|
|
liveins: $x0
|
|
; CHECK-LABEL: name: testExtOf2CopyOfTrunc
|
|
; CHECK: liveins: $x0
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY [[COPY]](s64)
|
|
; CHECK: $x0 = COPY [[COPY1]](s64)
|
|
; CHECK: RET_ReallyLR implicit $x0
|
|
%0(s64) = COPY $x0
|
|
%1(s1) = G_TRUNC %0
|
|
%2(s1) = COPY %1
|
|
%4:_(s1) = COPY %2
|
|
%3(s64) = G_ANYEXT %4
|
|
$x0 = COPY %3
|
|
RET_ReallyLR implicit $x0
|
|
|
|
...
|