[llvm] 9620fe0 - AMDGPU/GlobalISel: Add some G_INSERT/G_EXTRACT select tests
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 5 07:54:35 PDT 2020
Author: Matt Arsenault
Date: 2020-04-05T10:54:24-04:00
New Revision: 9620fe02dfedf7b272a61ff2dd16777ff53e4b03
URL: https://github.com/llvm/llvm-project/commit/9620fe02dfedf7b272a61ff2dd16777ff53e4b03
DIFF: https://github.com/llvm/llvm-project/commit/9620fe02dfedf7b272a61ff2dd16777ff53e4b03.diff
LOG: AMDGPU/GlobalISel: Add some G_INSERT/G_EXTRACT select tests
Added:
Modified:
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-extract.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-insert.mir
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-extract.mir b/llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-extract.mir
index d0159822432c..0d8739b957a5 100644
--- a/llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-extract.mir
+++ b/llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-extract.mir
@@ -219,3 +219,39 @@ body: |
S_ENDPGM 0, implicit %1, implicit %2
...
+
+---
+name: extract_sgpr_v2s16_from_v4s16_offset0
+legalized: true
+regBankSelected: true
+
+body: |
+ bb.0:
+ liveins: $sgpr0_sgpr1
+ ; CHECK-LABEL: name: extract_sgpr_v2s16_from_v4s16_offset0
+ ; CHECK: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
+ ; CHECK: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub0
+ ; CHECK: S_ENDPGM 0, implicit [[COPY1]]
+ %0:sgpr(<4 x s16>) = COPY $sgpr0_sgpr1
+ %1:sgpr(<2 x s16>) = G_EXTRACT %0, 0
+ S_ENDPGM 0, implicit %1
+
+...
+
+---
+name: extract_sgpr_v2s16_from_v4s16_offset32
+legalized: true
+regBankSelected: true
+
+body: |
+ bb.0:
+ liveins: $sgpr0_sgpr1
+ ; CHECK-LABEL: name: extract_sgpr_v2s16_from_v4s16_offset32
+ ; CHECK: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
+ ; CHECK: [[COPY1:%[0-9]+]]:sreg_32 = COPY [[COPY]].sub1
+ ; CHECK: S_ENDPGM 0, implicit [[COPY1]]
+ %0:sgpr(<4 x s16>) = COPY $sgpr0_sgpr1
+ %1:sgpr(<2 x s16>) = G_EXTRACT %0, 32
+ S_ENDPGM 0, implicit %1
+
+...
diff --git a/llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-insert.mir b/llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-insert.mir
index 9284fcd5f493..c6f67fbb9414 100644
--- a/llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-insert.mir
+++ b/llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-insert.mir
@@ -560,3 +560,41 @@ body: |
%2:vgpr(s256) = G_INSERT %0, %1, 128
S_ENDPGM 0, implicit %2
...
+
+---
+name: insert_sgpr_v2s16_to_v4s16_offset0
+legalized: true
+regBankSelected: true
+
+body: |
+ bb.0:
+ liveins: $sgpr0_sgpr1, $sgpr2
+ ; CHECK-LABEL: name: insert_sgpr_v2s16_to_v4s16_offset0
+ ; CHECK: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
+ ; CHECK: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr2
+ ; CHECK: [[INSERT_SUBREG:%[0-9]+]]:sreg_64 = INSERT_SUBREG [[COPY]], [[COPY1]], %subreg.sub0
+ ; CHECK: S_ENDPGM 0, implicit [[INSERT_SUBREG]]
+ %0:sgpr(<4 x s16>) = COPY $sgpr0_sgpr1
+ %1:sgpr(<2 x s16>) = COPY $sgpr2
+ %2:sgpr(<4 x s16>) = G_INSERT %0, %1, 0
+ S_ENDPGM 0, implicit %2
+
+...
+
+---
+name: insert_sgpr_v2s16_to_v4s16_offset32
+legalized: true
+regBankSelected: true
+
+body: |
+ bb.0:
+ liveins: $sgpr0_sgpr1, $sgpr2
+ ; CHECK-LABEL: name: insert_sgpr_v2s16_to_v4s16_offset32
+ ; CHECK: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
+ ; CHECK: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr2
+ ; CHECK: [[INSERT_SUBREG:%[0-9]+]]:sreg_64 = INSERT_SUBREG [[COPY]], [[COPY1]], %subreg.sub1
+ ; CHECK: S_ENDPGM 0, implicit [[INSERT_SUBREG]]
+ %0:sgpr(<4 x s16>) = COPY $sgpr0_sgpr1
+ %1:sgpr(<2 x s16>) = COPY $sgpr2
+ %2:sgpr(<4 x s16>) = G_INSERT %0, %1, 32
+ S_ENDPGM 0, implicit %2
More information about the llvm-commits
mailing list