summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-08-29 03:29:57 +0000
committerHal Finkel <hfinkel@anl.gov>2013-08-29 03:29:57 +0000
commit32f258b96a723b771eb44a2c0689b8bf4dd871ee (patch)
tree0a48bd05ecababcbe58e27cdd0dd15ab16c6f1f4 /include
parent253acef7a5ea2fbba7848d2257ae3cce2ea02ce0 (diff)
downloadllvm-32f258b96a723b771eb44a2c0689b8bf4dd871ee.tar.gz
llvm-32f258b96a723b771eb44a2c0689b8bf4dd871ee.tar.bz2
llvm-32f258b96a723b771eb44a2c0689b8bf4dd871ee.tar.xz
Add getUnrollingPreferences to TTI
Allow targets to customize the default behavior of the generic loop unrolling transformation. This will be used by the PowerPC backend when targeting the A2 core (which is in-order with a deep pipeline), and using more aggressive defaults is important. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189565 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/TargetTransformInfo.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/Analysis/TargetTransformInfo.h b/include/llvm/Analysis/TargetTransformInfo.h
index 06810a7de0..908612c6fa 100644
--- a/include/llvm/Analysis/TargetTransformInfo.h
+++ b/include/llvm/Analysis/TargetTransformInfo.h
@@ -191,6 +191,20 @@ public:
/// incurs significant execution cost.
virtual bool isLoweredToCall(const Function *F) const;
+ /// Parameters that control the generic loop unrolling transformation.
+ struct UnrollingPreferences {
+ unsigned Threshold; ///< The cost threshold for the unrolled loop.
+ unsigned OptSizeThreshold; ///< The cost threshold for the unrolled loop
+ ///< when optimizing for size.
+ bool Partial; ///< Allow partial loop unrolling.
+ bool Runtime; ///< Perform runtime unrolling.
+ };
+
+ /// \brief Get target-customized preferences for the generic loop unrolling
+ /// transformation. Returns true if the UnrollingPreferences struct has been
+ /// initialized.
+ virtual bool getUnrollingPreferences(UnrollingPreferences &UP) const;
+
/// @}
/// \name Scalar Target Information