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 -mtriple=x86_64-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=CHECK
|
2017-04-19 19:34:59 +08:00
|
|
|
--- |
|
|
|
|
define i1 @trunc_i32toi1(i32 %a) {
|
|
|
|
%r = trunc i32 %a to i1
|
|
|
|
ret i1 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8 @trunc_i32toi8(i32 %a) {
|
|
|
|
%r = trunc i32 %a to i8
|
|
|
|
ret i8 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i16 @trunc_i32toi16(i32 %a) {
|
|
|
|
%r = trunc i32 %a to i16
|
|
|
|
ret i16 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8 @trunc_i64toi8(i64 %a) {
|
|
|
|
%r = trunc i64 %a to i8
|
|
|
|
ret i8 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i16 @trunc_i64toi16(i64 %a) {
|
|
|
|
%r = trunc i64 %a to i16
|
|
|
|
ret i16 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @trunc_i64toi32(i64 %a) {
|
|
|
|
%r = trunc i64 %a to i32
|
|
|
|
ret i32 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: trunc_i32toi1
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 16
|
2017-04-19 19:34:59 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
2018-01-23 23:48:50 +08:00
|
|
|
- { id: 2, class: gpr }
|
2017-04-19 19:34:59 +08:00
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-04-19 19:34:59 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: trunc_i32toi1
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:gr32 = COPY $edi
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $al = COPY [[COPY1]]
|
|
|
|
; CHECK: RET 0, implicit $al
|
|
|
|
%0(s32) = COPY $edi
|
2017-04-19 19:34:59 +08:00
|
|
|
%1(s1) = G_TRUNC %0(s32)
|
2018-01-23 23:48:50 +08:00
|
|
|
%2(s8) = G_ANYEXT %1(s1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$al = COPY %2(s8)
|
|
|
|
RET 0, implicit $al
|
2017-04-19 19:34:59 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: trunc_i32toi8
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 16
|
2017-04-19 19:34:59 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-04-19 19:34:59 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: trunc_i32toi8
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:gr32 = COPY $edi
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $al = COPY [[COPY1]]
|
|
|
|
; CHECK: RET 0, implicit $al
|
|
|
|
%0(s32) = COPY $edi
|
2017-04-19 19:34:59 +08:00
|
|
|
%1(s8) = G_TRUNC %0(s32)
|
2018-02-01 06:04:26 +08:00
|
|
|
$al = COPY %1(s8)
|
|
|
|
RET 0, implicit $al
|
2017-04-19 19:34:59 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: trunc_i32toi16
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 16
|
2017-04-19 19:34:59 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-04-19 19:34:59 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: trunc_i32toi16
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:gr32 = COPY $edi
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:gr16 = COPY [[COPY]].sub_16bit
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $ax = COPY [[COPY1]]
|
|
|
|
; CHECK: RET 0, implicit $ax
|
|
|
|
%0(s32) = COPY $edi
|
2017-04-19 19:34:59 +08:00
|
|
|
%1(s16) = G_TRUNC %0(s32)
|
2018-02-01 06:04:26 +08:00
|
|
|
$ax = COPY %1(s16)
|
|
|
|
RET 0, implicit $ax
|
2017-04-19 19:34:59 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: trunc_i64toi8
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 16
|
2017-04-19 19:34:59 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $rdi
|
2017-04-19 19:34:59 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: trunc_i64toi8
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:gr64_with_sub_8bit = COPY $rdi
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $al = COPY [[COPY1]]
|
|
|
|
; CHECK: RET 0, implicit $al
|
|
|
|
%0(s64) = COPY $rdi
|
2017-04-19 19:34:59 +08:00
|
|
|
%1(s8) = G_TRUNC %0(s64)
|
2018-02-01 06:04:26 +08:00
|
|
|
$al = COPY %1(s8)
|
|
|
|
RET 0, implicit $al
|
2017-04-19 19:34:59 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: trunc_i64toi16
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 16
|
2017-04-19 19:34:59 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $rdi
|
2017-04-19 19:34:59 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: trunc_i64toi16
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:gr16 = COPY [[COPY]].sub_16bit
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $ax = COPY [[COPY1]]
|
|
|
|
; CHECK: RET 0, implicit $ax
|
|
|
|
%0(s64) = COPY $rdi
|
2017-04-19 19:34:59 +08:00
|
|
|
%1(s16) = G_TRUNC %0(s64)
|
2018-02-01 06:04:26 +08:00
|
|
|
$ax = COPY %1(s16)
|
|
|
|
RET 0, implicit $ax
|
2017-04-19 19:34:59 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: trunc_i64toi32
|
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67433
llvm-svn: 371608
2019-09-11 19:16:48 +08:00
|
|
|
alignment: 16
|
2017-04-19 19:34:59 +08:00
|
|
|
legalized: true
|
|
|
|
regBankSelected: true
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: gpr }
|
|
|
|
- { id: 1, class: gpr }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $rdi
|
2017-04-19 19:34:59 +08:00
|
|
|
|
2017-10-19 07:33:31 +08:00
|
|
|
; CHECK-LABEL: name: trunc_i64toi32
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:gr64 = COPY $rdi
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:gr32 = COPY [[COPY]].sub_32bit
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $eax = COPY [[COPY1]]
|
|
|
|
; CHECK: RET 0, implicit $eax
|
|
|
|
%0(s64) = COPY $rdi
|
2017-04-19 19:34:59 +08:00
|
|
|
%1(s32) = G_TRUNC %0(s64)
|
2018-02-01 06:04:26 +08:00
|
|
|
$eax = COPY %1(s32)
|
|
|
|
RET 0, implicit $eax
|
2017-04-19 19:34:59 +08:00
|
|
|
|
|
|
|
...
|