diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-12-19 14:34:28 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-12-19 14:34:28 +0000 |
commit | 35d346294128038794637b384fcc5f97ff3d9978 (patch) | |
tree | f0cb8a7e0df6a0b442aab42a73ca14734b309bfa /include | |
parent | f9a6bd8524ba16d3e4036304ffdc9475df6844f2 (diff) |
Make TargetLowering::getTypeConversion more resilient against odd illegal MVTs.
- An MVT can become an EVT when being split (e.g. v2i8 -> v1i8, the latter doesn't exist)
- Return the scalar value when an MVT is scalarized (v1i64 -> i64)
Fixes PR14639ff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170546 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index e159454934..f2ec08d93b 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -2005,8 +2005,11 @@ public: && "Promote may not follow Expand or Promote"); if (LA == TypeSplitVector) - NVT = MVT::getVectorVT(SVT.getVectorElementType(), - SVT.getVectorNumElements() / 2); + return LegalizeKind(LA, EVT::getVectorVT(Context, + SVT.getVectorElementType(), + SVT.getVectorNumElements()/2)); + if (LA == TypeScalarizeVector) + return LegalizeKind(LA, SVT.getVectorElementType()); return LegalizeKind(LA, NVT); } |