diff options
author | Tim Northover <tnorthover@apple.com> | 2016-08-25 17:37:39 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2016-08-25 17:37:39 +0000 |
commit | fe880a88012e777a77ea4f3153bad03b296788e5 (patch) | |
tree | f692f8d9a774737875d75ae40b259282c0219c8a /llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp | |
parent | 7a1ec0141ac6c24b3f5960cf3b98e52cfacfd800 (diff) | |
download | llvm-fe880a88012e777a77ea4f3153bad03b296788e5.zip llvm-fe880a88012e777a77ea4f3153bad03b296788e5.tar.gz llvm-fe880a88012e777a77ea4f3153bad03b296788e5.tar.bz2 |
GlobalISel: mark simple ops legal even on types < 32-bit.
The 32-bit variants of these operations don't depend on the bits not being
operated on, so they also naturally model operations narrower than the actual
register width.
llvm-svn: 279760
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp b/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp index 8ba6933..4e533dd 100644 --- a/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp +++ b/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp @@ -37,11 +37,10 @@ AArch64MachineLegalizer::AArch64MachineLegalizer() { const LLT v2s64 = LLT::vector(2, 64); for (auto BinOp : {G_ADD, G_SUB, G_MUL, G_AND, G_OR, G_XOR}) { - for (auto Ty : {s32, s64, v2s32, v4s32, v2s64}) + // These operations naturally get the right answer when used on + // GPR32, even if the actual type is narrower. + for (auto Ty : {s1, s8, s16, s32, s64, v2s32, v4s32, v2s64}) setAction({BinOp, Ty}, Legal); - - for (auto Ty : {s8, s16}) - setAction({BinOp, Ty}, WidenScalar); } for (auto BinOp : {G_SHL, G_LSHR, G_ASHR, G_SDIV, G_UDIV}) |