[PATCH] D97947: [AArch64] Force runtime unrolling for in-order scheduling models

Nicholas Guy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 4 06:40:45 PST 2021


NickGuy created this revision.
NickGuy added reviewers: SjoerdMeijer, dmgreen.
NickGuy added a project: LLVM.
Herald added subscribers: danielkiss, zzheng, hiraditya, kristof.beyls.
NickGuy requested review of this revision.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97947

Files:
  llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
  llvm/test/Transforms/LoopUnroll/AArch64/runtime-loop.ll


Index: llvm/test/Transforms/LoopUnroll/AArch64/runtime-loop.ll
===================================================================
--- llvm/test/Transforms/LoopUnroll/AArch64/runtime-loop.ll
+++ llvm/test/Transforms/LoopUnroll/AArch64/runtime-loop.ll
@@ -1,5 +1,7 @@
 ; RUN: opt < %s -S -loop-unroll -mtriple aarch64 -mcpu=cortex-a57 -unroll-runtime-epilog=true  | FileCheck %s -check-prefix=EPILOG
 ; RUN: opt < %s -S -loop-unroll -mtriple aarch64 -mcpu=cortex-a57 -unroll-runtime-epilog=false | FileCheck %s -check-prefix=PROLOG
+; RUN: opt < %s -S -loop-unroll -mtriple aarch64 -mcpu=cortex-r82 -unroll-runtime-epilog=true  | FileCheck %s -check-prefix=EPILOG
+; RUN: opt < %s -S -loop-unroll -mtriple aarch64 -mcpu=cortex-r82 -unroll-runtime-epilog=false | FileCheck %s -check-prefix=PROLOG
 
 ; Tests for unrolling loops with run-time trip counts
 
Index: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
+++ llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
@@ -977,6 +977,8 @@
   if (L->getLoopDepth() > 1)
     UP.PartialThreshold *= 2;
 
+  // Force runtime unrolling for in-order models
+  UP.Runtime |= !ST->getSchedModel().isOutOfOrder();
   // Disable partial & runtime unrolling on -Os.
   UP.PartialOptSizeThreshold = 0;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97947.328159.patch
Type: text/x-patch
Size: 1376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210304/c3ac0dab/attachment.bin>


More information about the llvm-commits mailing list