llvm.org GIT mirror llvm / 865802c
AMDGPU/GlobalISel: Mark G_BITCAST s32 <--> <2 x s16> legal Reviewers: arsenm Reviewed By: arsenm Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D34129 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305692 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 2 years ago
2 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
2828 using namespace TargetOpcode;
2929
3030 const LLT S1= LLT::scalar(1);
31 const LLT V2S16 = LLT::vector(2, 16);
3132 const LLT S32 = LLT::scalar(32);
3233 const LLT S64 = LLT::scalar(64);
3334 const LLT P1 = LLT::pointer(1, 64);
3435 const LLT P2 = LLT::pointer(2, 64);
3536
3637 setAction({G_ADD, S32}, Legal);
38
39 setAction({G_BITCAST, V2S16}, Legal);
40 setAction({G_BITCAST, 1, S32}, Legal);
41
42 setAction({G_BITCAST, S32}, Legal);
43 setAction({G_BITCAST, 1, V2S16}, Legal);
3744
3845 // FIXME: i1 operands to intrinsics should always be legal, but other i1
3946 // values may not be legal. We need to figure out how to distinguish
0 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=fiji -run-pass=legalizer -global-isel %s -o - | FileCheck %s
1
2 --- |
3 define void @test_bitcast() { ret void }
4 ...
5
6 ---
7 name: test_bitcast
8 registers:
9 - { id: 0, class: _ }
10 - { id: 1, class: _ }
11 - { id: 2, class: _ }
12 body: |
13 bb.0:
14 liveins: %vgpr0
15 ; CHECK-LABEL: name: test_bitcast
16 ; CHECK: %1(<2 x s16>) = G_BITCAST %0
17 ; CHECK: %2(s32) = G_BITCAST %1
18
19 %0(s32) = COPY %vgpr0
20 %1(<2 x s16>) = G_BITCAST %0
21 %2(s32) = G_BITCAST %1
22 ...