2017-02-23 02:47:41 +08:00
|
|
|
# RUN: llc -O0 -run-pass=legalizer -global-isel %s -o - | FileCheck %s
|
2016-08-24 03:30:38 +08:00
|
|
|
|
|
|
|
--- |
|
|
|
|
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
|
2016-10-14 18:19:40 +08:00
|
|
|
target triple = "aarch64--"
|
2016-08-24 03:30:38 +08:00
|
|
|
define void @test_simple() {
|
|
|
|
entry:
|
|
|
|
ret void
|
2016-08-24 05:01:20 +08:00
|
|
|
next:
|
|
|
|
ret void
|
2016-08-24 03:30:38 +08:00
|
|
|
}
|
2017-10-17 06:28:27 +08:00
|
|
|
define void @bitcast128() {
|
|
|
|
ret void
|
|
|
|
}
|
2016-08-24 03:30:38 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: test_simple
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
- { id: 2, class: _ }
|
2016-08-24 05:01:20 +08:00
|
|
|
- { id: 3, class: _ }
|
2016-08-27 01:45:58 +08:00
|
|
|
- { 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: _ }
|
2016-08-24 03:30:38 +08:00
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
liveins: %x0, %x1, %x2, %x3
|
2016-09-09 19:46:34 +08:00
|
|
|
%0(s64) = COPY %x0
|
2016-08-24 03:30:38 +08:00
|
|
|
|
2017-01-20 08:30:09 +08:00
|
|
|
%1(s1) = G_TRUNC %0
|
|
|
|
%2(s8) = G_TRUNC %0
|
|
|
|
%3(s16) = G_TRUNC %0
|
2016-09-09 19:46:34 +08:00
|
|
|
%4(s32) = G_TRUNC %0
|
2016-08-27 01:45:58 +08:00
|
|
|
|
2017-01-20 08:30:09 +08:00
|
|
|
; CHECK-LABEL: name: test_simple
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: %5:_(p0) = G_INTTOPTR %0
|
|
|
|
; CHECK: %6:_(s64) = G_PTRTOINT %5
|
2017-01-20 08:30:09 +08:00
|
|
|
%5(p0) = G_INTTOPTR %0
|
|
|
|
%6(s64) = G_PTRTOINT %5
|
2016-08-27 01:45:58 +08:00
|
|
|
|
2017-01-20 08:30:09 +08:00
|
|
|
; CHECK: G_BRCOND %1(s1), %bb.1.next
|
|
|
|
G_BRCOND %1, %bb.1.next
|
2016-08-27 01:45:58 +08:00
|
|
|
|
2017-01-20 08:30:09 +08:00
|
|
|
bb.1.next:
|
2016-08-27 01:46:03 +08:00
|
|
|
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[LHS:%[0-9]+]]:_(s32) = G_TRUNC %0
|
|
|
|
; CHECK: [[RHS:%[0-9]+]]:_(s32) = G_TRUNC %0
|
|
|
|
; CHECK: [[RES:%[0-9]+]]:_(s32) = G_SELECT %1(s1), [[LHS]], [[RHS]]
|
|
|
|
; CHECK: %7:_(s1) = G_TRUNC [[RES]](s32)
|
2017-01-20 08:30:09 +08:00
|
|
|
%7(s1) = G_SELECT %1, %1, %1
|
2017-02-07 07:41:27 +08:00
|
|
|
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[LHS:%[0-9]+]]:_(s32) = G_TRUNC %0
|
|
|
|
; CHECK: [[RHS:%[0-9]+]]:_(s32) = G_TRUNC %0
|
|
|
|
; CHECK: [[RES:%[0-9]+]]:_(s32) = G_SELECT %1(s1), [[LHS]], [[RHS]]
|
|
|
|
; CHECK: %8:_(s8) = G_TRUNC [[RES]](s32)
|
2017-01-20 08:30:09 +08:00
|
|
|
%8(s8) = G_SELECT %1, %2, %2
|
2017-02-07 07:41:27 +08:00
|
|
|
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[LHS:%[0-9]+]]:_(s32) = G_TRUNC %0
|
|
|
|
; CHECK: [[RHS:%[0-9]+]]:_(s32) = G_TRUNC %0
|
|
|
|
; CHECK: [[RES:%[0-9]+]]:_(s32) = G_SELECT %1(s1), [[LHS]], [[RHS]]
|
|
|
|
; CHECK: %9:_(s16) = G_TRUNC [[RES]](s32)
|
2017-01-20 08:30:09 +08:00
|
|
|
%9(s16) = G_SELECT %1, %3, %3
|
2017-02-07 07:41:27 +08:00
|
|
|
|
2017-01-20 08:30:09 +08:00
|
|
|
%10(s32) = G_SELECT %1, %4, %4
|
|
|
|
%11(s64) = G_SELECT %1, %0, %0
|
2016-10-12 11:57:43 +08:00
|
|
|
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: %12:_(<2 x s32>) = G_BITCAST %0
|
|
|
|
; CHECK: %13:_(s64) = G_BITCAST %12
|
|
|
|
; CHECK: %14:_(s32) = G_BITCAST %10
|
|
|
|
; CHECK: %15:_(<4 x s8>) = G_BITCAST %0
|
|
|
|
; CHECK: %16:_(<2 x s16>) = G_BITCAST %0
|
2017-01-20 08:30:09 +08:00
|
|
|
%12(<2 x s32>) = G_BITCAST %0
|
|
|
|
%13(s64) = G_BITCAST %12
|
|
|
|
%14(s32) = G_BITCAST %10
|
|
|
|
%15(<4 x s8>) = G_BITCAST %0
|
|
|
|
%16(<2 x s16>) = G_BITCAST %0
|
2016-08-24 03:30:38 +08:00
|
|
|
...
|
2017-10-17 06:28:27 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
name: bitcast128
|
|
|
|
tracksRegLiveness: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _}
|
|
|
|
- { id: 1, class: _}
|
|
|
|
- { id: 2, class: _}
|
|
|
|
- { id: 3, class: _}
|
|
|
|
body: |
|
|
|
|
bb.1:
|
|
|
|
liveins: %x0, %x1
|
|
|
|
; CHECK-LABEL: bitcast128
|
|
|
|
; This is legal and shouldn't be changed.
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: %2:_(<2 x s64>) = G_BITCAST %3(s128)
|
2017-10-17 06:28:27 +08:00
|
|
|
%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
|
|
|
|
|
|
|
|
...
|