[PATCH] D87786: [LoopUnrollAndJam] Allow unroll and jam loops forced by user.
Whitney Tsang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 17 12:40:54 PDT 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Whitney marked an inline comment as done.
Closed by commit rG1cee33e9dbb6: [LoopUnrollAndJam] Allow unroll and jam loops forced by user. (authored by Whitney).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87786/new/
https://reviews.llvm.org/D87786
Files:
llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
llvm/test/Transforms/LoopUnrollAndJam/pragma-explicit.ll
Index: llvm/test/Transforms/LoopUnrollAndJam/pragma-explicit.ll
===================================================================
--- llvm/test/Transforms/LoopUnrollAndJam/pragma-explicit.ll
+++ llvm/test/Transforms/LoopUnrollAndJam/pragma-explicit.ll
@@ -1,5 +1,5 @@
-; RUN: opt -loop-unroll-and-jam -allow-unroll-and-jam -unroll-runtime -unroll-partial-threshold=60 < %s -S | FileCheck %s
-; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='loop-unroll-and-jam' -allow-unroll-and-jam -unroll-runtime -unroll-partial-threshold=60 < %s -S | FileCheck %s
+; RUN: opt -loop-unroll-and-jam -unroll-runtime -unroll-partial-threshold=60 < %s -S | FileCheck %s
+; RUN: opt -aa-pipeline=tbaa,basic-aa -passes='loop-unroll-and-jam' -unroll-runtime -unroll-partial-threshold=60 < %s -S | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
Index: llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
===================================================================
--- llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
+++ llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
@@ -288,6 +288,13 @@
None, None, None, None, None);
TargetTransformInfo::PeelingPreferences PP =
gatherPeelingPreferences(L, SE, TTI, None, None);
+
+ TransformationMode EnableMode = hasUnrollAndJamTransformation(L);
+ if (EnableMode & TM_Disable)
+ return LoopUnrollResult::Unmodified;
+ if (EnableMode & TM_ForcedByUser)
+ UP.UnrollAndJam = true;
+
if (AllowUnrollAndJam.getNumOccurrences() > 0)
UP.UnrollAndJam = AllowUnrollAndJam;
if (UnrollAndJamThreshold.getNumOccurrences() > 0)
@@ -300,10 +307,6 @@
<< L->getHeader()->getParent()->getName() << "] Loop %"
<< L->getHeader()->getName() << "\n");
- TransformationMode EnableMode = hasUnrollAndJamTransformation(L);
- if (EnableMode & TM_Disable)
- return LoopUnrollResult::Unmodified;
-
// A loop with any unroll pragma (enabling/disabling/count/etc) is left for
// the unroller, so long as it does not explicitly have unroll_and_jam
// metadata. This means #pragma nounroll will disable unroll and jam as well
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87786.292593.patch
Type: text/x-patch
Size: 2224 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200917/f42da3e4/attachment.bin>
More information about the llvm-commits
mailing list