summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp b/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp
index 881b5026fa6..fa23627de7c 100644
--- a/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp
@@ -119,8 +119,9 @@ LLT MachineLegalizer::findLegalType(unsigned Opcode, LLT Ty,
[&](LLT Ty) -> LLT { return Ty.halfScalarSize(); });
}
case WidenScalar: {
- return findLegalType(Opcode, Ty,
- [&](LLT Ty) -> LLT { return Ty.doubleScalarSize(); });
+ return findLegalType(Opcode, Ty, [&](LLT Ty) -> LLT {
+ return Ty.getSizeInBits() < 8 ? LLT::scalar(8) : Ty.doubleScalarSize();
+ });
}
case FewerElements: {
return findLegalType(Opcode, Ty,
OpenPOWER on IntegriCloud