[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 07:31:22 PDT 2020
Whitney updated this revision to Diff 292497.
Whitney retitled this revision from "[PPC][LoopUnrollAndJam] Allow unroll and jam loops forced by user." to "[LoopUnrollAndJam] Allow unroll and jam loops forced by user.".
Whitney added a reviewer: dmgreen.
Herald added a subscriber: zzheng.
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.292497.patch
Type: text/x-patch
Size: 2224 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200917/14a54ca4/attachment.bin>
More information about the llvm-commits
mailing list