diff options
| author | Tim Northover <tnorthover@apple.com> | 2017-07-20 22:58:38 +0000 |
|---|---|---|
| committer | Tim Northover <tnorthover@apple.com> | 2017-07-20 22:58:38 +0000 |
| commit | 7b6d66c0c94f390105cc5f14d30330bc0eaf228d (patch) | |
| tree | 035ab80c26607c3aff49cd612eaeb1e2f87700e9 /llvm/test/CodeGen | |
| parent | 071d77a51f333b084de7be38f37864ef5862b8c8 (diff) | |
| download | bcm5719-llvm-7b6d66c0c94f390105cc5f14d30330bc0eaf228d.tar.gz bcm5719-llvm-7b6d66c0c94f390105cc5f14d30330bc0eaf228d.zip | |
Recommit: GlobalISel: select G_EXTRACT and G_INSERT instructions on AArch64.
It revealed a bug in the Localizer pass which has now been fixed.
This includes the fix for SUBREG_TO_REG committed separately last time.
llvm-svn: 308688
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/AArch64/GlobalISel/select-insert-extract.mir | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/select-insert-extract.mir b/llvm/test/CodeGen/AArch64/GlobalISel/select-insert-extract.mir new file mode 100644 index 00000000000..e88e151bd24 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/GlobalISel/select-insert-extract.mir @@ -0,0 +1,54 @@ +# RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs -global-isel %s -o - | FileCheck %s + +--- +# CHECK-LABEL: name: insert_gprs +name: insert_gprs +legalized: true +regBankSelected: true + +body: | + bb.0: + liveins: %x0 + + %0:gpr(s32) = COPY %w0 + + %1:gpr(s64) = G_IMPLICIT_DEF + + ; CHECK: body: + ; CHECK: [[TMP:%[0-9]+]] = SUBREG_TO_REG 0, %0, 15 + ; CHECK: %2 = BFMXri %1, [[TMP]], 0, 31 + %2:gpr(s64) = G_INSERT %1, %0, 0 + + ; CHECK: [[TMP:%[0-9]+]] = SUBREG_TO_REG 0, %0, 15 + ; CHECK: %3 = BFMXri %1, [[TMP]], 51, 31 + %3:gpr(s64) = G_INSERT %1, %0, 13 + + %x0 = COPY %2 + %x1 = COPY %3 +... + + +--- +# CHECK-LABEL: name: extract_gprs +name: extract_gprs +legalized: true +regBankSelected: true + +body: | + bb.0: + liveins: %x0 + + %0:gpr(s64) = COPY %x0 + + ; CHECK: body: + ; CHECK: [[TMP:%[0-9]+]] = UBFMXri %0, 0, 31 + ; CHECK: %1 = COPY [[TMP]].sub_32 + %1:gpr(s32) = G_EXTRACT %0, 0 + + ; CHECK: [[TMP:%[0-9]+]] = UBFMXri %0, 13, 44 + ; CHECK: %2 = COPY [[TMP]].sub_32 + %2:gpr(s32) = G_EXTRACT %0, 13 + + %w0 = COPY %1 + %w1 = COPY %2 +... |

