diff options
| author | Quentin Colombet <qcolombet@apple.com> | 2017-10-16 22:28:27 +0000 |
|---|---|---|
| committer | Quentin Colombet <qcolombet@apple.com> | 2017-10-16 22:28:27 +0000 |
| commit | 7c114d3d707c4295f6ca3f7e5dfe59ce531b0ddd (patch) | |
| tree | 7128569ea6c011ecac7c45186ac7dbc4f8384fd3 /llvm | |
| parent | 36bbc8ce98b4d0dd4fb0b5d42b3aec032da21a7f (diff) | |
| download | bcm5719-llvm-7c114d3d707c4295f6ca3f7e5dfe59ce531b0ddd.tar.gz bcm5719-llvm-7c114d3d707c4295f6ca3f7e5dfe59ce531b0ddd.zip | |
[AArch64][LegalizerInfo] Mark s128 G_BITCAST legal
We used to mark all G_BITCAST of 128-bit legal but only for vector
types. Scalars of this size are just fine as well.
llvm-svn: 315945
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp | 4 | ||||
| -rw-r--r-- | llvm/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir | 26 |
2 files changed, 29 insertions, 1 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp index 0fdd0ba6f32..2d45be37ca7 100644 --- a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp @@ -31,6 +31,7 @@ AArch64LegalizerInfo::AArch64LegalizerInfo() { const LLT s16 = LLT::scalar(16); const LLT s32 = LLT::scalar(32); const LLT s64 = LLT::scalar(64); + const LLT s128 = LLT::scalar(128); const LLT v2s32 = LLT::vector(2, 32); const LLT v4s32 = LLT::vector(4, 32); const LLT v2s64 = LLT::vector(2, 64); @@ -229,7 +230,8 @@ AArch64LegalizerInfo::AArch64LegalizerInfo() { setAction({G_INTTOPTR, 1, s64}, Legal); // Casts for 32 and 64-bit width type are just copies. - for (auto Ty : {s1, s8, s16, s32, s64}) { + // Same for 128-bit width type, except they are on the FPR bank. + for (auto Ty : {s1, s8, s16, s32, s64, s128}) { setAction({G_BITCAST, 0, Ty}, Legal); setAction({G_BITCAST, 1, Ty}, Legal); } diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir index d2a02a3f65b..495ea6c7504 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir +++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-simple.mir @@ -9,6 +9,9 @@ next: ret void } + define void @bitcast128() { + ret void + } ... --- @@ -84,3 +87,26 @@ body: | %15(<4 x s8>) = G_BITCAST %0 %16(<2 x s16>) = G_BITCAST %0 ... + +--- +name: bitcast128 +tracksRegLiveness: true +registers: + - { id: 0, class: _} + - { id: 1, class: _} + - { id: 2, class: _} + - { id: 3, class: _} +body: | + bb.1: + liveins: %x0, %x1 + ; CHECK-LABEL: bitcast128 + ; This is legal and shouldn't be changed. + ; CHECK: %2(<2 x s64>) = G_BITCAST %3(s128) + %0(s64) = COPY %x0 + %1(s64) = COPY %x1 + %3(s128) = G_MERGE_VALUES %0(s64), %1(s64) + %2(<2 x s64>) = G_BITCAST %3(s128) + %q0 = COPY %2(<2 x s64>) + RET_ReallyLR implicit %q0 + +... |

