[PATCH] D30719: AMDGPU/SI: Disable unrolling in the loop vectorizer if the loop is not vectorized.

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 14:14:01 PST 2017


cfang created this revision.
Herald added subscribers: tpr, dstuttard, tony-tye, yaxunl, nhaehnle, wdng, kzhuravl.

This additional unrolling (interleaving) will increase the register usage, and most likely hurts the performance.


https://reviews.llvm.org/D30719

Files:
  lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp


Index: lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
===================================================================
--- lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
+++ lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
@@ -155,6 +155,10 @@
 }
 
 unsigned AMDGPUTTIImpl::getMaxInterleaveFactor(unsigned VF) {
+  // Disable unrolling if the loop is not vectorized.
+  if (VF == 1)
+    return 1;
+
   // Semi-arbitrary large amount.
   return 64;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30719.90934.patch
Type: text/x-patch
Size: 456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170307/3e47f92d/attachment.bin>


More information about the llvm-commits mailing list