2017-10-19 07:18:12 +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=legalizer %s -o - | FileCheck %s
|
2017-05-01 14:30:16 +08:00
|
|
|
|
|
|
|
--- |
|
2017-05-10 14:52:58 +08:00
|
|
|
define i64 @test_sext_i1(i8 %a) {
|
|
|
|
%val = trunc i8 %a to i1
|
|
|
|
%r = sext i1 %val to i64
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
2017-05-01 14:30:16 +08:00
|
|
|
define i64 @test_sext_i8(i8 %val) {
|
|
|
|
%r = sext i8 %val to i64
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test_sext_i16(i16 %val) {
|
|
|
|
%r = sext i16 %val to i64
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test_sext_i32(i32 %val) {
|
|
|
|
%r = sext i32 %val to i64
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
2017-05-10 14:52:58 +08:00
|
|
|
define i64 @test_zext_i1(i8 %a) {
|
|
|
|
%val = trunc i8 %a to i1
|
|
|
|
%r = zext i1 %val to i64
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
2017-05-01 14:30:16 +08:00
|
|
|
define i64 @test_zext_i8(i8 %val) {
|
|
|
|
%r = zext i8 %val to i64
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test_zext_i16(i16 %val) {
|
|
|
|
%r = zext i16 %val to i64
|
|
|
|
ret i64 %r
|
|
|
|
}
|
|
|
|
|
|
|
|
define i64 @test_zext_i32(i32 %val) {
|
|
|
|
%r = zext i32 %val to i64
|
|
|
|
ret i64 %r
|
|
|
|
}
|
2017-10-19 07:18:12 +08:00
|
|
|
|
2017-09-11 17:41:13 +08:00
|
|
|
define void @test_anyext_i1(i8 %a) {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test_anyext_i8(i8 %val) {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test_anyext_i16(i16 %val) {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test_anyext_i32(i32 %val) {
|
|
|
|
ret void
|
|
|
|
}
|
2017-10-19 07:18:12 +08:00
|
|
|
|
2017-05-01 14:30:16 +08:00
|
|
|
|
2017-05-10 14:52:58 +08:00
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_sext_i1
|
|
|
|
alignment: 4
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
- { id: 2, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-05-10 14:52:58 +08:00
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_sext_i1
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s8) = COPY $dil
|
[GlobalISel][X86] Support G_LSHR/G_ASHR/G_SHL
Support G_LSHR/G_ASHR/G_SHL. We have 3 variance for
shift instructions : shift gpr, shift imm, shift 1.
Currently GlobalIsel TableGen generate patterns for
shift imm and shift 1, but with shiftCount i8.
In G_LSHR/G_ASHR/G_SHL like LLVM-IR both arguments
has the same type, so for now only shift i8 can use
auto generated TableGen patterns.
The support of G_SHL/G_ASHR enables tryCombineSExt
from LegalizationArtifactCombiner.h to hit, which
results in different legalization for the following tests:
LLVM :: CodeGen/X86/GlobalISel/ext-x86-64.ll
LLVM :: CodeGen/X86/GlobalISel/gep.ll
LLVM :: CodeGen/X86/GlobalISel/legalize-ext-x86-64.mir
-; X64-NEXT: movsbl %dil, %eax
+; X64-NEXT: movl $24, %ecx
+; X64-NEXT: # kill: def $cl killed $ecx
+; X64-NEXT: shll %cl, %edi
+; X64-NEXT: movl $24, %ecx
+; X64-NEXT: # kill: def $cl killed $ecx
+; X64-NEXT: sarl %cl, %edi
+; X64-NEXT: movl %edi, %eax
..which is not optimal and should be addressed later.
Rework of the patch by igorb
Reviewed By: igorb
Differential Revision: https://reviews.llvm.org/D44395
llvm-svn: 327499
2018-03-14 19:23:57 +08:00
|
|
|
; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
|
|
|
|
; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s8)
|
|
|
|
; CHECK: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[ANYEXT]], [[C]]
|
|
|
|
; CHECK: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]]
|
|
|
|
; CHECK: $rax = COPY [[ASHR]](s64)
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: RET 0, implicit $rax
|
|
|
|
%0(s8) = COPY $dil
|
2017-05-10 14:52:58 +08:00
|
|
|
%1(s1) = G_TRUNC %0(s8)
|
|
|
|
%2(s64) = G_SEXT %1(s1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$rax = COPY %2(s64)
|
|
|
|
RET 0, implicit $rax
|
2017-05-10 14:52:58 +08:00
|
|
|
|
2017-05-01 14:30:16 +08:00
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_sext_i8
|
|
|
|
alignment: 4
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-05-01 14:30:16 +08:00
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_sext_i8
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s8) = COPY $dil
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[COPY]](s8)
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $rax = COPY [[SEXT]](s64)
|
|
|
|
; CHECK: RET 0, implicit $rax
|
|
|
|
%0(s8) = COPY $dil
|
2017-05-01 14:30:16 +08:00
|
|
|
%1(s64) = G_SEXT %0(s8)
|
2018-02-01 06:04:26 +08:00
|
|
|
$rax = COPY %1(s64)
|
|
|
|
RET 0, implicit $rax
|
2017-05-01 14:30:16 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_sext_i16
|
|
|
|
alignment: 4
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-05-01 14:30:16 +08:00
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_sext_i16
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $di
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[COPY]](s16)
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $rax = COPY [[SEXT]](s64)
|
|
|
|
; CHECK: RET 0, implicit $rax
|
|
|
|
%0(s16) = COPY $di
|
2017-05-01 14:30:16 +08:00
|
|
|
%1(s64) = G_SEXT %0(s16)
|
2018-02-01 06:04:26 +08:00
|
|
|
$rax = COPY %1(s64)
|
|
|
|
RET 0, implicit $rax
|
2017-05-01 14:30:16 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_sext_i32
|
|
|
|
alignment: 4
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-05-01 14:30:16 +08:00
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_sext_i32
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[COPY]](s32)
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $rax = COPY [[SEXT]](s64)
|
|
|
|
; CHECK: RET 0, implicit $rax
|
|
|
|
%0(s32) = COPY $edi
|
2017-05-01 14:30:16 +08:00
|
|
|
%1(s64) = G_SEXT %0(s32)
|
2018-02-01 06:04:26 +08:00
|
|
|
$rax = COPY %1(s64)
|
|
|
|
RET 0, implicit $rax
|
2017-05-01 14:30:16 +08:00
|
|
|
|
2017-05-10 14:52:58 +08:00
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_zext_i1
|
|
|
|
alignment: 4
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
- { id: 2, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-05-10 14:52:58 +08:00
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_zext_i1
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s8) = COPY $dil
|
[GISel]: Rework legalization algorithm for better elimination of
artifacts along with DCE
Legalization Artifacts are all those insts that are there to make the
type system happy. Currently, the target needs to say all combinations
of extends and truncs are legal and there's no way of verifying that
post legalization, we only have *truly* legal instructions. This patch
changes roughly the legalization algorithm to process all illegal insts
at one go, and then process all truncs/extends that were added to
satisfy the type constraints separately trying to combine trivial cases
until they converge. This has the added benefit that, the target
legalizerinfo can only say which truncs and extends are okay and the
artifact combiner would combine away other exts and truncs.
Updated legalization algorithm to roughly the following pseudo code.
WorkList Insts, Artifacts;
collect_all_insts_and_artifacts(Insts, Artifacts);
do {
for (Inst in Insts)
legalizeInstrStep(Inst, Insts, Artifacts);
for (Artifact in Artifacts)
tryCombineArtifact(Artifact, Insts, Artifacts);
} while(!Insts.empty());
Also, wrote a simple wrapper equivalent to SetVector, except for
erasing, it avoids moving all elements over by one and instead just
nulls them out.
llvm-svn: 318210
2017-11-15 06:42:19 +08:00
|
|
|
; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
|
|
|
|
; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s8)
|
|
|
|
; CHECK: [[AND:%[0-9]+]]:_(s64) = G_AND [[ANYEXT]], [[C]]
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $rax = COPY [[AND]](s64)
|
|
|
|
; CHECK: RET 0, implicit $rax
|
|
|
|
%0(s8) = COPY $dil
|
2017-05-10 14:52:58 +08:00
|
|
|
%1(s1) = G_TRUNC %0(s8)
|
|
|
|
%2(s64) = G_ZEXT %1(s1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$rax = COPY %2(s64)
|
|
|
|
RET 0, implicit $rax
|
2017-05-10 14:52:58 +08:00
|
|
|
|
2017-05-01 14:30:16 +08:00
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_zext_i8
|
|
|
|
alignment: 4
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-05-01 14:30:16 +08:00
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_zext_i8
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s8) = COPY $dil
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s8)
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $rax = COPY [[ZEXT]](s64)
|
|
|
|
; CHECK: RET 0, implicit $rax
|
|
|
|
%0(s8) = COPY $dil
|
2017-05-01 14:30:16 +08:00
|
|
|
%1(s64) = G_ZEXT %0(s8)
|
2018-02-01 06:04:26 +08:00
|
|
|
$rax = COPY %1(s64)
|
|
|
|
RET 0, implicit $rax
|
2017-05-01 14:30:16 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_zext_i16
|
|
|
|
alignment: 4
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-05-01 14:30:16 +08:00
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_zext_i16
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $di
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s16)
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $rax = COPY [[ZEXT]](s64)
|
|
|
|
; CHECK: RET 0, implicit $rax
|
|
|
|
%0(s16) = COPY $di
|
2017-05-01 14:30:16 +08:00
|
|
|
%1(s64) = G_ZEXT %0(s16)
|
2018-02-01 06:04:26 +08:00
|
|
|
$rax = COPY %1(s64)
|
|
|
|
RET 0, implicit $rax
|
2017-05-01 14:30:16 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_zext_i32
|
|
|
|
alignment: 4
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-05-01 14:30:16 +08:00
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_zext_i32
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s32)
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $rax = COPY [[ZEXT]](s64)
|
|
|
|
; CHECK: RET 0, implicit $rax
|
|
|
|
%0(s32) = COPY $edi
|
2017-05-01 14:30:16 +08:00
|
|
|
%1(s64) = G_ZEXT %0(s32)
|
2018-02-01 06:04:26 +08:00
|
|
|
$rax = COPY %1(s64)
|
|
|
|
RET 0, implicit $rax
|
2017-05-01 14:30:16 +08:00
|
|
|
|
|
|
|
...
|
2017-09-11 17:41:13 +08:00
|
|
|
---
|
|
|
|
name: test_anyext_i1
|
|
|
|
alignment: 4
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
- { id: 2, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-09-11 17:41:13 +08:00
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_anyext_i1
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s8) = COPY $dil
|
[GISel]: Rework legalization algorithm for better elimination of
artifacts along with DCE
Legalization Artifacts are all those insts that are there to make the
type system happy. Currently, the target needs to say all combinations
of extends and truncs are legal and there's no way of verifying that
post legalization, we only have *truly* legal instructions. This patch
changes roughly the legalization algorithm to process all illegal insts
at one go, and then process all truncs/extends that were added to
satisfy the type constraints separately trying to combine trivial cases
until they converge. This has the added benefit that, the target
legalizerinfo can only say which truncs and extends are okay and the
artifact combiner would combine away other exts and truncs.
Updated legalization algorithm to roughly the following pseudo code.
WorkList Insts, Artifacts;
collect_all_insts_and_artifacts(Insts, Artifacts);
do {
for (Inst in Insts)
legalizeInstrStep(Inst, Insts, Artifacts);
for (Artifact in Artifacts)
tryCombineArtifact(Artifact, Insts, Artifacts);
} while(!Insts.empty());
Also, wrote a simple wrapper equivalent to SetVector, except for
erasing, it avoids moving all elements over by one and instead just
nulls them out.
llvm-svn: 318210
2017-11-15 06:42:19 +08:00
|
|
|
; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s8)
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $rax = COPY [[ANYEXT]](s64)
|
|
|
|
; CHECK: RET 0, implicit $rax
|
|
|
|
%0(s8) = COPY $dil
|
2017-09-11 17:41:13 +08:00
|
|
|
%1(s1) = G_TRUNC %0(s8)
|
|
|
|
%2(s64) = G_ANYEXT %1(s1)
|
2018-02-01 06:04:26 +08:00
|
|
|
$rax = COPY %2(s64)
|
|
|
|
RET 0, implicit $rax
|
2017-09-11 17:41:13 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_anyext_i8
|
|
|
|
alignment: 4
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-09-11 17:41:13 +08:00
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_anyext_i8
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s8) = COPY $dil
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s8)
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $rax = COPY [[ANYEXT]](s64)
|
|
|
|
; CHECK: RET 0, implicit $rax
|
|
|
|
%0(s8) = COPY $dil
|
2017-09-11 17:41:13 +08:00
|
|
|
%1(s64) = G_ANYEXT %0(s8)
|
2018-02-01 06:04:26 +08:00
|
|
|
$rax = COPY %1(s64)
|
|
|
|
RET 0, implicit $rax
|
2017-09-11 17:41:13 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_anyext_i16
|
|
|
|
alignment: 4
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-09-11 17:41:13 +08:00
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_anyext_i16
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s16) = COPY $di
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s16)
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $rax = COPY [[ANYEXT]](s64)
|
|
|
|
; CHECK: RET 0, implicit $rax
|
|
|
|
%0(s16) = COPY $di
|
2017-09-11 17:41:13 +08:00
|
|
|
%1(s64) = G_ANYEXT %0(s16)
|
2018-02-01 06:04:26 +08:00
|
|
|
$rax = COPY %1(s64)
|
|
|
|
RET 0, implicit $rax
|
2017-09-11 17:41:13 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: test_anyext_i32
|
|
|
|
alignment: 4
|
|
|
|
legalized: false
|
|
|
|
regBankSelected: false
|
|
|
|
registers:
|
|
|
|
- { id: 0, class: _ }
|
|
|
|
- { id: 1, class: _ }
|
|
|
|
body: |
|
|
|
|
bb.1 (%ir-block.0):
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $edi
|
2017-09-11 17:41:13 +08:00
|
|
|
|
2017-10-19 07:18:12 +08:00
|
|
|
; CHECK-LABEL: name: test_anyext_i32
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $edi
|
2017-10-25 02:04:54 +08:00
|
|
|
; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[COPY]](s32)
|
2018-02-01 06:04:26 +08:00
|
|
|
; CHECK: $rax = COPY [[ANYEXT]](s64)
|
|
|
|
; CHECK: RET 0, implicit $rax
|
|
|
|
%0(s32) = COPY $edi
|
2017-09-11 17:41:13 +08:00
|
|
|
%1(s64) = G_ANYEXT %0(s32)
|
2018-02-01 06:04:26 +08:00
|
|
|
$rax = COPY %1(s64)
|
|
|
|
RET 0, implicit $rax
|
2017-09-11 17:41:13 +08:00
|
|
|
|
|
|
|
...
|
|
|
|
|