diff options
| author | Quentin Colombet <qcolombet@apple.com> | 2016-10-13 00:12:01 +0000 |
|---|---|---|
| committer | Quentin Colombet <qcolombet@apple.com> | 2016-10-13 00:12:01 +0000 |
| commit | db643d90918857921ae49c2c719c3a502a7138cc (patch) | |
| tree | d31e37d73baa142908a6b12e09263c9aeca9192e /llvm/lib/Target | |
| parent | f760799c4013823a1f82a66316f4bd96fd699d06 (diff) | |
| download | bcm5719-llvm-db643d90918857921ae49c2c719c3a502a7138cc.tar.gz bcm5719-llvm-db643d90918857921ae49c2c719c3a502a7138cc.zip | |
[AArch64][MachineLegalizer] Mark more G_BITCAST as legal.
Basically any vector types that fits in a 32-bit register is also valid
as far as copies are concerned.
llvm-svn: 284089
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp b/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp index 4f921e8d8ef..46261bca67c 100644 --- a/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp +++ b/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp @@ -181,14 +181,21 @@ AArch64MachineLegalizer::AArch64MachineLegalizer() { setAction({G_BITCAST, 1, Ty}, Legal); } + // For the sake of copying bits around, the type does not really + // matter as long as it fits a register. for (int EltSize = 8; EltSize <= 64; EltSize *= 2) { setAction({G_BITCAST, 0, LLT::vector(128/EltSize, EltSize)}, Legal); setAction({G_BITCAST, 1, LLT::vector(128/EltSize, EltSize)}, Legal); - if (EltSize == 64) + if (EltSize >= 64) continue; setAction({G_BITCAST, 0, LLT::vector(64/EltSize, EltSize)}, Legal); setAction({G_BITCAST, 1, LLT::vector(64/EltSize, EltSize)}, Legal); + if (EltSize >= 32) + continue; + + setAction({G_BITCAST, 0, LLT::vector(32/EltSize, EltSize)}, Legal); + setAction({G_BITCAST, 1, LLT::vector(32/EltSize, EltSize)}, Legal); } computeTables(); |

