[PATCH] D87786: [PPC][LoopUnrollAndJam] Allow unroll and jam loops forced by user.

Whitney Tsang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 12:13:05 PDT 2020


Whitney created this revision.
Whitney added reviewers: hfinkel, PowerPC, bmahjour, etiotto, Meinersbur.
Whitney added a project: LLVM.
Herald added subscribers: llvm-commits, kbarton, hiraditya, nemanjai.
Whitney requested review of this revision.

Allow unroll and jam loops forced by user. 
LoopUnrollAndJamPass is still disabled by default in the NPM pipeline, and can be controlled by `-enable-npm-unroll-and-jam`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87786

Files:
  llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp


Index: llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
===================================================================
--- llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
+++ llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
@@ -19,6 +19,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Transforms/InstCombine/InstCombiner.h"
 #include "llvm/Transforms/Utils/Local.h"
+#include "llvm/Transforms/Utils/LoopUtils.h"
 
 using namespace llvm;
 
@@ -753,6 +754,11 @@
     UP.AllowExpensiveTripCount = true;
   }
 
+  // Enable unroll and jam for loops forced by user.
+  TransformationMode EnableMode = hasUnrollAndJamTransformation(L);
+  if (EnableMode & TM_ForcedByUser)
+    UP.UnrollAndJam = true;
+
   BaseT::getUnrollingPreferences(L, SE, UP);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87786.292303.patch
Type: text/x-patch
Size: 767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200916/87d1f141/attachment.bin>


More information about the llvm-commits mailing list