diff options
| author | Jingyue Wu <jingyue@google.com> | 2015-07-10 04:31:56 +0000 |
|---|---|---|
| committer | Jingyue Wu <jingyue@google.com> | 2015-07-10 04:31:56 +0000 |
| commit | ad85c8c2048708be55a9e5c82d734031bb75632a (patch) | |
| tree | 833cc443fa49b0a8339ce1e4bc8feaeceaa6addc /llvm/lib | |
| parent | c851ccc3bd38b0887615f9b39950d07ffc66da0a (diff) | |
| download | bcm5719-llvm-ad85c8c2048708be55a9e5c82d734031bb75632a.tar.gz bcm5719-llvm-ad85c8c2048708be55a9e5c82d734031bb75632a.zip | |
[NVPTX] declare no vector registers
Summary:
Without this patch, LoopVectorizer in certain cases (see loop-vectorize.ll)
produces code with complex control flow which hurts later optimizations. Since
NVPTX doesn't have vector registers in LLVM's sense
(NVPTXTTI::getRegisterBitWidth(true) == 32), we for now declare no vector
registers to effectively disable loop vectorization.
Reviewers: jholewinski
Subscribers: jingyue, llvm-commits, jholewinski
Differential Revision: http://reviews.llvm.org/D11089
llvm-svn: 241884
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp index 241b145f719..232148d2f8a 100644 --- a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp @@ -117,3 +117,9 @@ unsigned NVPTXTTIImpl::getArithmeticInstrCost( Opd1PropInfo, Opd2PropInfo); } } + +unsigned NVPTXTTIImpl::getNumberOfRegisters(bool Vector) { + if (Vector) + return 0; + return BaseT::getNumberOfRegisters(Vector); +} diff --git a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h index c8a855ae8b0..18c9fa985ae 100644 --- a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h +++ b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h @@ -58,6 +58,8 @@ public: TTI::OperandValueKind Opd2Info = TTI::OK_AnyValue, TTI::OperandValueProperties Opd1PropInfo = TTI::OP_None, TTI::OperandValueProperties Opd2PropInfo = TTI::OP_None); + + unsigned getNumberOfRegisters(bool Vector); }; } // end namespace llvm |

