summaryrefslogtreecommitdiff
path: root/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorRobert Lytton <robert@xmos.com>2013-09-18 12:43:35 +0000
committerRobert Lytton <robert@xmos.com>2013-09-18 12:43:35 +0000
commitd072d1b2a36f6c6e1b4b513dc69e91b61ad8c21a (patch)
tree352624eb2bc4107396f55510201c2acbd682aebe /lib/Transforms/Vectorize/LoopVectorize.cpp
parentaf96481135473f8da6de06f5ad18c09bd376a50f (diff)
downloadllvm-d072d1b2a36f6c6e1b4b513dc69e91b61ad8c21a.tar.gz
llvm-d072d1b2a36f6c6e1b4b513dc69e91b61ad8c21a.tar.bz2
llvm-d072d1b2a36f6c6e1b4b513dc69e91b61ad8c21a.tar.xz
Prevent LoopVectorizer and SLPVectorizer running if the target has no vector registers.
XCore target: Add XCoreTargetTransformInfo This is where getNumberOfRegisters() resides, which in turn returns the number of vector registers (=0). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190936 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--lib/Transforms/Vectorize/LoopVectorize.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp
index 1d82c7b8f5..30908c8ebf 100644
--- a/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -909,6 +909,11 @@ struct LoopVectorize : public LoopPass {
DT = &getAnalysis<DominatorTree>();
TLI = getAnalysisIfAvailable<TargetLibraryInfo>();
+ // If the target claims to have no vector registers don't attempt
+ // vectorization.
+ if (!TTI->getNumberOfRegisters(true))
+ return false;
+
if (DL == NULL) {
DEBUG(dbgs() << "LV: Not vectorizing because of missing data layout");
return false;