2017-10-19 07:33:31 +08:00
|
|
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
2018-05-06 05:19:59 +08:00
|
|
|
# RUN: llc -O0 -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
|
2017-03-16 00:29:37 +08:00
|
|
|
|
|
|
|
--- |
|
|
|
|
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
|
|
|
|
|
|
|
|
define void @bitcast_s32_gpr() { ret void }
|
|
|
|
define void @bitcast_s32_fpr() { ret void }
|
|
|
|
define void @bitcast_s32_gpr_fpr() { ret void }
|
|
|
|
define void @bitcast_s32_fpr_gpr() { ret void }
|
|
|
|
define void @bitcast_s64_gpr() { ret void }
|
|
|
|
define void @bitcast_s64_fpr() { ret void }
|
|
|
|
define void @bitcast_s64_gpr_fpr() { ret void }
|
|
|
|
define void @bitcast_s64_fpr_gpr() { ret void }
|
Re-commit: [globalisel][tablegen] Support zero-instruction emission.
Summary:
Support the case where an operand of a pattern is also the whole of the
result pattern. In this case the original result and all its uses must be
replaced by the operand. However, register class restrictions can require
a COPY. This patch handles both cases by always emitting the copy and
leaving it for the register allocator to optimize.
The previous commit failed on Windows machines due to a flaw in the sort
predicate which allowed both A < B < C and B == C to be satisfied
simultaneously. The cause of this was some sloppiness in the priority order of
G_CONSTANT instructions compared to other instructions. These had equal priority
because it makes no difference, however there were operands had higher priority
than G_CONSTANT but lower priority than any other instruction. As a result, a
priority order between G_CONSTANT and other instructions must be enforced to
ensure the predicate defines a strict weak order.
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Subscribers: javed.absar, kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D36084
llvm-svn: 311076
2017-08-17 17:26:14 +08:00
|
|
|
define void @bitcast_s64_v2f32_fpr() { ret void }
|
|
|
|
define void @bitcast_s64_v8i8_fpr() { ret void }
|
2017-03-16 00:29:37 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: bitcast_s32_gpr
|
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $w0
|
2017-03-16 00:29:37 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: bitcast_s32_gpr
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:gpr32all = COPY $w0
|
|
|
|
; CHECK: $w0 = COPY [[COPY]]
|
|
|
|
%0(s32) = COPY $w0
|
2017-03-16 00:29:37 +08:00
|
|
|
%1(s32) = G_BITCAST %0
|
2018-02-01 06:04:26 +08:00
|
|
|
$w0 = COPY %1(s32)
|
2017-03-16 00:29:37 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: bitcast_s32_fpr
|
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: fpr }
|
|
|
|
- { id: 1, class: fpr }
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $s0
|
2017-03-16 00:29:37 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: bitcast_s32_fpr
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
|
|
|
|
; CHECK: $s0 = COPY [[COPY]]
|
|
|
|
%0(s32) = COPY $s0
|
2017-03-16 00:29:37 +08:00
|
|
|
%1(s32) = G_BITCAST %0
|
2018-02-01 06:04:26 +08:00
|
|
|
$s0 = COPY %1(s32)
|
2017-03-16 00:29:37 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: bitcast_s32_gpr_fpr
|
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: fpr }
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $w0
|
2017-03-16 00:29:37 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: bitcast_s32_gpr_fpr
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:gpr32all = COPY $w0
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY [[COPY]]
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $s0 = COPY [[COPY1]]
|
|
|
|
%0(s32) = COPY $w0
|
2017-03-16 00:29:37 +08:00
|
|
|
%1(s32) = G_BITCAST %0
|
2018-02-01 06:04:26 +08:00
|
|
|
$s0 = COPY %1(s32)
|
2017-03-16 00:29:37 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: bitcast_s32_fpr_gpr
|
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: fpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $s0
|
2017-03-16 00:29:37 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: bitcast_s32_fpr_gpr
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:fpr32 = COPY $s0
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY [[COPY]]
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $w0 = COPY [[COPY1]]
|
|
|
|
%0(s32) = COPY $s0
|
2017-03-16 00:29:37 +08:00
|
|
|
%1(s32) = G_BITCAST %0
|
2018-02-01 06:04:26 +08:00
|
|
|
$w0 = COPY %1(s32)
|
2017-03-16 00:29:37 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: bitcast_s64_gpr
|
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $x0
|
2017-03-16 00:29:37 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: bitcast_s64_gpr
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:gpr64all = COPY $x0
|
|
|
|
; CHECK: $x0 = COPY [[COPY]]
|
|
|
|
%0(s64) = COPY $x0
|
2017-03-16 00:29:37 +08:00
|
|
|
%1(s64) = G_BITCAST %0
|
2018-02-01 06:04:26 +08:00
|
|
|
$x0 = COPY %1(s64)
|
2017-03-16 00:29:37 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: bitcast_s64_fpr
|
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: fpr }
|
|
|
|
- { id: 1, class: fpr }
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $d0
|
2017-03-16 00:29:37 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: bitcast_s64_fpr
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
|
|
|
|
; CHECK: $d0 = COPY [[COPY]]
|
|
|
|
%0(s64) = COPY $d0
|
2017-03-16 00:29:37 +08:00
|
|
|
%1(s64) = G_BITCAST %0
|
2018-02-01 06:04:26 +08:00
|
|
|
$d0 = COPY %1(s64)
|
2017-03-16 00:29:37 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: bitcast_s64_gpr_fpr
|
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: fpr }
|
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $x0
|
2017-03-16 00:29:37 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: bitcast_s64_gpr_fpr
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:gpr64all = COPY $x0
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY [[COPY]]
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $d0 = COPY [[COPY1]]
|
|
|
|
%0(s64) = COPY $x0
|
2017-03-16 00:29:37 +08:00
|
|
|
%1(s64) = G_BITCAST %0
|
2018-02-01 06:04:26 +08:00
|
|
|
$d0 = COPY %1(s64)
|
2017-03-16 00:29:37 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: bitcast_s64_fpr_gpr
|
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: fpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $d0
|
2017-03-16 00:29:37 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: bitcast_s64_fpr_gpr
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY [[COPY]]
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $x0 = COPY [[COPY1]]
|
|
|
|
%0(s64) = COPY $d0
|
2017-03-16 00:29:37 +08:00
|
|
|
%1(s64) = G_BITCAST %0
|
2018-02-01 06:04:26 +08:00
|
|
|
$x0 = COPY %1(s64)
|
2017-03-16 00:29:37 +08:00
|
|
|
...
|
Re-commit: [globalisel][tablegen] Support zero-instruction emission.
Summary:
Support the case where an operand of a pattern is also the whole of the
result pattern. In this case the original result and all its uses must be
replaced by the operand. However, register class restrictions can require
a COPY. This patch handles both cases by always emitting the copy and
leaving it for the register allocator to optimize.
The previous commit failed on Windows machines due to a flaw in the sort
predicate which allowed both A < B < C and B == C to be satisfied
simultaneously. The cause of this was some sloppiness in the priority order of
G_CONSTANT instructions compared to other instructions. These had equal priority
because it makes no difference, however there were operands had higher priority
than G_CONSTANT but lower priority than any other instruction. As a result, a
priority order between G_CONSTANT and other instructions must be enforced to
ensure the predicate defines a strict weak order.
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Subscribers: javed.absar, kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D36084
llvm-svn: 311076
2017-08-17 17:26:14 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
name: bitcast_s64_v2f32_fpr
|
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: fpr }
|
|
|
|
- { id: 1, class: fpr }
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $d0
|
Re-commit: [globalisel][tablegen] Support zero-instruction emission.
Summary:
Support the case where an operand of a pattern is also the whole of the
result pattern. In this case the original result and all its uses must be
replaced by the operand. However, register class restrictions can require
a COPY. This patch handles both cases by always emitting the copy and
leaving it for the register allocator to optimize.
The previous commit failed on Windows machines due to a flaw in the sort
predicate which allowed both A < B < C and B == C to be satisfied
simultaneously. The cause of this was some sloppiness in the priority order of
G_CONSTANT instructions compared to other instructions. These had equal priority
because it makes no difference, however there were operands had higher priority
than G_CONSTANT but lower priority than any other instruction. As a result, a
priority order between G_CONSTANT and other instructions must be enforced to
ensure the predicate defines a strict weak order.
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Subscribers: javed.absar, kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D36084
llvm-svn: 311076
2017-08-17 17:26:14 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: bitcast_s64_v2f32_fpr
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
|
|
|
|
; CHECK: $x0 = COPY [[COPY]]
|
|
|
|
%0(s64) = COPY $d0
|
Re-commit: [globalisel][tablegen] Support zero-instruction emission.
Summary:
Support the case where an operand of a pattern is also the whole of the
result pattern. In this case the original result and all its uses must be
replaced by the operand. However, register class restrictions can require
a COPY. This patch handles both cases by always emitting the copy and
leaving it for the register allocator to optimize.
The previous commit failed on Windows machines due to a flaw in the sort
predicate which allowed both A < B < C and B == C to be satisfied
simultaneously. The cause of this was some sloppiness in the priority order of
G_CONSTANT instructions compared to other instructions. These had equal priority
because it makes no difference, however there were operands had higher priority
than G_CONSTANT but lower priority than any other instruction. As a result, a
priority order between G_CONSTANT and other instructions must be enforced to
ensure the predicate defines a strict weak order.
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Subscribers: javed.absar, kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D36084
llvm-svn: 311076
2017-08-17 17:26:14 +08:00
|
|
|
%1(<2 x s32>) = G_BITCAST %0
|
2018-02-01 06:04:26 +08:00
|
|
|
$x0 = COPY %1(<2 x s32>)
|
Re-commit: [globalisel][tablegen] Support zero-instruction emission.
Summary:
Support the case where an operand of a pattern is also the whole of the
result pattern. In this case the original result and all its uses must be
replaced by the operand. However, register class restrictions can require
a COPY. This patch handles both cases by always emitting the copy and
leaving it for the register allocator to optimize.
The previous commit failed on Windows machines due to a flaw in the sort
predicate which allowed both A < B < C and B == C to be satisfied
simultaneously. The cause of this was some sloppiness in the priority order of
G_CONSTANT instructions compared to other instructions. These had equal priority
because it makes no difference, however there were operands had higher priority
than G_CONSTANT but lower priority than any other instruction. As a result, a
priority order between G_CONSTANT and other instructions must be enforced to
ensure the predicate defines a strict weak order.
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Subscribers: javed.absar, kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D36084
llvm-svn: 311076
2017-08-17 17:26:14 +08:00
|
|
|
...
|
|
|
|
|
|
|
|
---
|
|
|
|
name: bitcast_s64_v8i8_fpr
|
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: fpr }
|
|
|
|
- { id: 1, class: fpr }
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $d0
|
Re-commit: [globalisel][tablegen] Support zero-instruction emission.
Summary:
Support the case where an operand of a pattern is also the whole of the
result pattern. In this case the original result and all its uses must be
replaced by the operand. However, register class restrictions can require
a COPY. This patch handles both cases by always emitting the copy and
leaving it for the register allocator to optimize.
The previous commit failed on Windows machines due to a flaw in the sort
predicate which allowed both A < B < C and B == C to be satisfied
simultaneously. The cause of this was some sloppiness in the priority order of
G_CONSTANT instructions compared to other instructions. These had equal priority
because it makes no difference, however there were operands had higher priority
than G_CONSTANT but lower priority than any other instruction. As a result, a
priority order between G_CONSTANT and other instructions must be enforced to
ensure the predicate defines a strict weak order.
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Subscribers: javed.absar, kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D36084
llvm-svn: 311076
2017-08-17 17:26:14 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: bitcast_s64_v8i8_fpr
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
|
|
|
|
; CHECK: $x0 = COPY [[COPY]]
|
|
|
|
%0(s64) = COPY $d0
|
Re-commit: [globalisel][tablegen] Support zero-instruction emission.
Summary:
Support the case where an operand of a pattern is also the whole of the
result pattern. In this case the original result and all its uses must be
replaced by the operand. However, register class restrictions can require
a COPY. This patch handles both cases by always emitting the copy and
leaving it for the register allocator to optimize.
The previous commit failed on Windows machines due to a flaw in the sort
predicate which allowed both A < B < C and B == C to be satisfied
simultaneously. The cause of this was some sloppiness in the priority order of
G_CONSTANT instructions compared to other instructions. These had equal priority
because it makes no difference, however there were operands had higher priority
than G_CONSTANT but lower priority than any other instruction. As a result, a
priority order between G_CONSTANT and other instructions must be enforced to
ensure the predicate defines a strict weak order.
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Subscribers: javed.absar, kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D36084
llvm-svn: 311076
2017-08-17 17:26:14 +08:00
|
|
|
%1(<8 x s8>) = G_BITCAST %0
|
2018-02-01 06:04:26 +08:00
|
|
|
$x0 = COPY %1(<8 x s8>)
|
Re-commit: [globalisel][tablegen] Support zero-instruction emission.
Summary:
Support the case where an operand of a pattern is also the whole of the
result pattern. In this case the original result and all its uses must be
replaced by the operand. However, register class restrictions can require
a COPY. This patch handles both cases by always emitting the copy and
leaving it for the register allocator to optimize.
The previous commit failed on Windows machines due to a flaw in the sort
predicate which allowed both A < B < C and B == C to be satisfied
simultaneously. The cause of this was some sloppiness in the priority order of
G_CONSTANT instructions compared to other instructions. These had equal priority
because it makes no difference, however there were operands had higher priority
than G_CONSTANT but lower priority than any other instruction. As a result, a
priority order between G_CONSTANT and other instructions must be enforced to
ensure the predicate defines a strict weak order.
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Subscribers: javed.absar, kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D36084
llvm-svn: 311076
2017-08-17 17:26:14 +08:00
|
|
|
...
|