diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-07-17 13:43:33 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-07-17 13:43:33 +0000 |
commit | 1a4f3c93fb083c9449b255afb5f178c5982b3582 (patch) | |
tree | bc724390b6f3f0452098870ecca381909062f573 /llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | |
parent | c41e096bdab0fd5a1e08b8cac55a589d71d3339c (diff) | |
download | bcm5719-llvm-1a4f3c93fb083c9449b255afb5f178c5982b3582.tar.gz bcm5719-llvm-1a4f3c93fb083c9449b255afb5f178c5982b3582.zip |
[SLPVectorizer] Don't attempt horizontal reduction on pointer types (PR38191)
TTI::getMinMaxReductionCost typically can't handle pointer types - until this is changed its better to limit horizontal reduction to integer/float vector types only.
llvm-svn: 337280
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index c992d2f9991..cc4fd0f764e 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -5632,6 +5632,8 @@ public: Type *Ty = B->getType(); if (!isValidElementType(Ty)) return false; + if (!Ty->isIntOrIntVectorTy() && !Ty->isFPOrFPVectorTy()) + return false; ReducedValueData.clear(); ReductionRoot = B; |