diff options
| author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-01-31 18:01:49 +0000 | 
|---|---|---|
| committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-01-31 18:01:49 +0000 | 
| commit | 4b94d2597d14db78bc0f3296f4f63b33d61621e0 (patch) | |
| tree | 2f9cc026487a0239b30c5e09ef3268a68da85c23 | |
| parent | 9f4563bbd2e07d3a8f5288dac9991d992551bfe4 (diff) | |
| download | bcm5719-llvm-4b94d2597d14db78bc0f3296f4f63b33d61621e0.tar.gz bcm5719-llvm-4b94d2597d14db78bc0f3296f4f63b33d61621e0.zip | |
GlobalISel: Fix handling of vectors of pointers in clamp{Min,Max}NumElements
This avoids hitting the assert added in r352636 in a future commit.
llvm-svn: 352777
| -rw-r--r-- | llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h | 8 | 
1 files changed, 3 insertions, 5 deletions
| diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h index 393af1529f0..17acfc2c3c7 100644 --- a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h @@ -712,7 +712,7 @@ public:          [=](const LegalityQuery &Query) {            LLT VecTy = Query.Types[TypeIdx];            return std::make_pair( -              TypeIdx, LLT::vector(MinElements, VecTy.getScalarSizeInBits())); +              TypeIdx, LLT::vector(MinElements, VecTy.getElementType()));          });    }    /// Limit the number of elements in EltTy vectors to at most MaxElements. @@ -729,10 +729,8 @@ public:          },          [=](const LegalityQuery &Query) {            LLT VecTy = Query.Types[TypeIdx]; -          if (MaxElements == 1) -            return std::make_pair(TypeIdx, VecTy.getElementType()); -          return std::make_pair( -              TypeIdx, LLT::vector(MaxElements, VecTy.getScalarSizeInBits())); +          LLT NewTy = LLT::scalarOrVector(MaxElements, VecTy.getElementType()); +          return std::make_pair(TypeIdx, NewTy);          });    }    /// Limit the number of elements for the given vectors to at least MinTy's | 

