Set the loop unroll's threshold to 1024.

Submitted by Yang, Rong R on July 1, 2015, 3:31 a.m.

Details

Message ID 1435721477-1929-1-git-send-email-rong.r.yang@intel.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Yang, Rong R July 1, 2015, 3:31 a.m.
LLVM's default threshold is 150, too small. In general, the loop unroll
in GEN can improve the perfomance, so enlarge it to 1024.

Signed-off-by: Yang Rong <rong.r.yang@intel.com>
---
 backend/src/llvm/llvm_to_gen.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/backend/src/llvm/llvm_to_gen.cpp b/backend/src/llvm/llvm_to_gen.cpp
index e0f6bf2..891f2a1 100644
--- a/backend/src/llvm/llvm_to_gen.cpp
+++ b/backend/src/llvm/llvm_to_gen.cpp
@@ -160,7 +160,7 @@  namespace gbe
     MPM.add(createIndVarSimplifyPass());        // Canonicalize indvars
     MPM.add(createLoopIdiomPass());             // Recognize idioms like memset.
     MPM.add(createLoopDeletionPass());          // Delete dead loops
-    MPM.add(createLoopUnrollPass()); //1024, 32, 1024, 512)); //Unroll loops
+    MPM.add(createLoopUnrollPass(1024)); //1024, 32, 1024, 512)); //Unroll loops
     if(optLevel > 0) {
       MPM.add(createSROAPass(/*RequiresDomTree*/ false));
       MPM.add(createGVNPass());                 // Remove redundancies

Comments

Selecting a reasonable threshold seems a difficult job. I am ok with 1024.
LGTM.

> -----Original Message-----

> From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of

> Yang Rong

> Sent: Wednesday, July 01, 2015 11:31 AM

> To: beignet@lists.freedesktop.org

> Cc: Yang, Rong R

> Subject: [Beignet] [PATCH] Set the loop unroll's threshold to 1024.

> 

> LLVM's default threshold is 150, too small. In general, the loop unroll in GEN

> can improve the perfomance, so enlarge it to 1024.

> 

> Signed-off-by: Yang Rong <rong.r.yang@intel.com>

> ---

>  backend/src/llvm/llvm_to_gen.cpp | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/backend/src/llvm/llvm_to_gen.cpp

> b/backend/src/llvm/llvm_to_gen.cpp

> index e0f6bf2..891f2a1 100644

> --- a/backend/src/llvm/llvm_to_gen.cpp

> +++ b/backend/src/llvm/llvm_to_gen.cpp

> @@ -160,7 +160,7 @@ namespace gbe

>      MPM.add(createIndVarSimplifyPass());        // Canonicalize

> indvars

>      MPM.add(createLoopIdiomPass());             // Recognize idioms

> like memset.

>      MPM.add(createLoopDeletionPass());          // Delete dead loops

> -    MPM.add(createLoopUnrollPass()); //1024, 32, 1024, 512)); //Unroll

> loops

> +    MPM.add(createLoopUnrollPass(1024)); //1024, 32, 1024, 512));

> + //Unroll loops

>      if(optLevel > 0) {

>        MPM.add(createSROAPass(/*RequiresDomTree*/ false));

>        MPM.add(createGVNPass());                 // Remove

> redundancies

> --

> 1.8.3.2

> 

> _______________________________________________

> Beignet mailing list

> Beignet@lists.freedesktop.org

> http://lists.freedesktop.org/mailman/listinfo/beignet