summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
diff options
context:
space:
mode:
authorChangpeng Fang <changpeng.fang@gmail.com>2017-03-09 00:07:00 +0000
committerChangpeng Fang <changpeng.fang@gmail.com>2017-03-09 00:07:00 +0000
commit1be9b9f81694617edd85e28f03cab07b3864f7e1 (patch)
tree7c3a14b6cc00daac79830b98d94f1f0c27d65fe4 /llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
parent8537d9994dbd041da176059449d060f2f320fc1a (diff)
downloadbcm5719-llvm-1be9b9f81694617edd85e28f03cab07b3864f7e1.tar.gz
bcm5719-llvm-1be9b9f81694617edd85e28f03cab07b3864f7e1.zip
AMDGPU/SI: Disable unrolling in the loop vectorizer if the loop is not vectorized.
Reviewers: arsenm Differential Revision: http://reviews.llvm.org/D30719 llvm-svn: 297328
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
index a780a76c86a..4a6d12bd883 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -155,6 +155,10 @@ bool AMDGPUTTIImpl::isLegalToVectorizeStoreChain(unsigned ChainSizeInBytes,
}
unsigned AMDGPUTTIImpl::getMaxInterleaveFactor(unsigned VF) {
+ // Disable unrolling if the loop is not vectorized.
+ if (VF == 1)
+ return 1;
+
// Semi-arbitrary large amount.
return 64;
}
OpenPOWER on IntegriCloud