LLVM 20.0.0git
|
Parameters that control the generic loop unrolling transformation. More...
#include "llvm/Analysis/TargetTransformInfo.h"
Public Attributes | |
unsigned | Threshold |
The cost threshold for the unrolled loop. | |
unsigned | MaxPercentThresholdBoost |
If complete unrolling will reduce the cost of the loop, we will boost the Threshold by a certain percent to allow more aggressive complete unrolling. | |
unsigned | OptSizeThreshold |
The cost threshold for the unrolled loop when optimizing for size (set to UINT_MAX to disable). | |
unsigned | PartialThreshold |
The cost threshold for the unrolled loop, like Threshold, but used for partial/runtime unrolling (set to UINT_MAX to disable). | |
unsigned | PartialOptSizeThreshold |
The cost threshold for the unrolled loop when optimizing for size, like OptSizeThreshold, but used for partial/runtime unrolling (set to UINT_MAX to disable). | |
unsigned | Count |
A forced unrolling factor (the number of concatenated bodies of the original loop in the unrolled loop body). | |
unsigned | DefaultUnrollRuntimeCount |
Default unroll count for loops with run-time trip count. | |
unsigned | MaxCount |
unsigned | MaxUpperBound |
Set the maximum upper bound of trip count. | |
unsigned | FullUnrollMaxCount |
Set the maximum unrolling factor for full unrolling. | |
unsigned | BEInsns |
bool | Partial |
Allow partial unrolling (unrolling of loops to expand the size of the loop body, not only to eliminate small constant-trip-count loops). | |
bool | Runtime |
Allow runtime unrolling (unrolling of loops to expand the size of the loop body even when the number of loop iterations is not known at compile time). | |
bool | AllowRemainder |
Allow generation of a loop remainder (extra iterations after unroll). | |
bool | AllowExpensiveTripCount |
Allow emitting expensive instructions (such as divisions) when computing the trip count of a loop for runtime unrolling. | |
bool | Force |
Apply loop unroll on any kind of loop (mainly to loops that fail runtime unrolling). | |
bool | UpperBound |
Allow using trip count upper bound to unroll loops. | |
bool | UnrollRemainder |
Allow unrolling of all the iterations of the runtime loop remainder. | |
bool | UnrollAndJam |
Allow unroll and jam. Used to enable unroll and jam for the target. | |
unsigned | UnrollAndJamInnerLoopThreshold |
Threshold for unroll and jam, for inner loop size. | |
unsigned | MaxIterationsCountToAnalyze |
Don't allow loop unrolling to simulate more than this number of iterations when checking full unroll profitability. | |
bool | UnrollVectorizedLoop = false |
Don't disable runtime unroll for the loops which were vectorized. | |
unsigned | SCEVExpansionBudget |
Don't allow runtime unrolling if expanding the trip count takes more than SCEVExpansionBudget. | |
Parameters that control the generic loop unrolling transformation.
Definition at line 530 of file TargetTransformInfo.h.
bool llvm::TargetTransformInfo::UnrollingPreferences::AllowExpensiveTripCount |
Allow emitting expensive instructions (such as divisions) when computing the trip count of a loop for runtime unrolling.
Definition at line 596 of file TargetTransformInfo.h.
Referenced by llvm::computeUnrollCount(), llvm::gatherUnrollingPreferences(), llvm::PPCTTIImpl::getUnrollingPreferences(), llvm::SystemZTTIImpl::getUnrollingPreferences(), and tryToUnrollLoop().
bool llvm::TargetTransformInfo::UnrollingPreferences::AllowRemainder |
Allow generation of a loop remainder (extra iterations after unroll).
Definition at line 593 of file TargetTransformInfo.h.
Referenced by computeUnrollAndJamCount(), llvm::computeUnrollCount(), llvm::gatherUnrollingPreferences(), shouldPartialUnroll(), shouldPragmaUnroll(), and tryToUnrollLoop().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::BEInsns |
Definition at line 584 of file TargetTransformInfo.h.
Referenced by computeHeuristicUnrollFactor(), llvm::gatherUnrollingPreferences(), getUnrollAndJammedLoopSize(), llvm::UnrollCostEstimator::getUnrolledLoopSize(), llvm::BasicTTIImplBase< T >::getUnrollingPreferences(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), llvm::WebAssemblyTTIImpl::getUnrollingPreferences(), shouldPartialUnroll(), tryToUnrollAndJamLoop(), and tryToUnrollLoop().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::Count |
A forced unrolling factor (the number of concatenated bodies of the original loop in the unrolled loop body).
When set to 0, the unrolling transformation will select an unrolling factor based on the current cost threshold and other factors.
Definition at line 564 of file TargetTransformInfo.h.
Referenced by computeHeuristicUnrollFactor(), computeUnrollAndJamCount(), llvm::computeUnrollCount(), llvm::gatherUnrollingPreferences(), getUnrollAndJammedLoopSize(), llvm::UnrollCostEstimator::getUnrolledLoopSize(), shouldPartialUnroll(), tryToUnrollAndJamLoop(), and tryToUnrollLoop().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::DefaultUnrollRuntimeCount |
Default unroll count for loops with run-time trip count.
Definition at line 566 of file TargetTransformInfo.h.
Referenced by llvm::computeUnrollCount(), llvm::gatherUnrollingPreferences(), getAppleRuntimeUnrollPreferences(), llvm::AArch64TTIImpl::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), llvm::SystemZTTIImpl::getUnrollingPreferences(), and shouldPartialUnroll().
bool llvm::TargetTransformInfo::UnrollingPreferences::Force |
Apply loop unroll on any kind of loop (mainly to loops that fail runtime unrolling).
Definition at line 599 of file TargetTransformInfo.h.
Referenced by computeHeuristicUnrollFactor(), computeUnrollAndJamCount(), llvm::computeUnrollCount(), llvm::gatherUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), llvm::RISCVTTIImpl::getUnrollingPreferences(), llvm::SystemZTTIImpl::getUnrollingPreferences(), and tryToUnrollLoop().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::FullUnrollMaxCount |
Set the maximum unrolling factor for full unrolling.
Like MaxCount, but applies even if full unrolling is selected. This allows a target to fall back to Partial unrolling if full unrolling is above FullUnrollMaxCount.
Definition at line 579 of file TargetTransformInfo.h.
Referenced by llvm::gatherUnrollingPreferences(), llvm::SystemZTTIImpl::getUnrollingPreferences(), and shouldFullUnroll().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::MaxCount |
Definition at line 571 of file TargetTransformInfo.h.
Referenced by llvm::computeUnrollCount(), llvm::gatherUnrollingPreferences(), getFalkorUnrollingPreferences(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), llvm::SystemZTTIImpl::getUnrollingPreferences(), and shouldPartialUnroll().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::MaxIterationsCountToAnalyze |
Don't allow loop unrolling to simulate more than this number of iterations when checking full unroll profitability.
Definition at line 613 of file TargetTransformInfo.h.
Referenced by llvm::gatherUnrollingPreferences(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), and shouldFullUnroll().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::MaxPercentThresholdBoost |
If complete unrolling will reduce the cost of the loop, we will boost the Threshold by a certain percent to allow more aggressive complete unrolling.
This value provides the maximum boost percentage that we can apply to Threshold (The value should be no less than 100). BoostedThreshold = Threshold * min(RolledCost / UnrolledCost, MaxPercentThresholdBoost / 100) E.g. if complete unrolling reduces the loop execution time by 50% then we boost the threshold by the factor of 2x. If unrolling is not expected to reduce the running time, then we do not increase the threshold.
Definition at line 549 of file TargetTransformInfo.h.
Referenced by llvm::gatherUnrollingPreferences(), and shouldFullUnroll().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::MaxUpperBound |
Set the maximum upper bound of trip count.
Allowing the MaxUpperBound to be overrided by a target gives more flexiblity on certain cases. By default, MaxUpperBound uses UnrollMaxUpperBound which value is 8.
Definition at line 575 of file TargetTransformInfo.h.
Referenced by llvm::computeUnrollCount(), llvm::gatherUnrollingPreferences(), and shouldPragmaUnroll().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::OptSizeThreshold |
The cost threshold for the unrolled loop when optimizing for size (set to UINT_MAX to disable).
Definition at line 552 of file TargetTransformInfo.h.
Referenced by computeHeuristicUnrollFactor(), llvm::gatherUnrollingPreferences(), llvm::BasicTTIImplBase< T >::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), llvm::RISCVTTIImpl::getUnrollingPreferences(), and llvm::WebAssemblyTTIImpl::getUnrollingPreferences().
bool llvm::TargetTransformInfo::UnrollingPreferences::Partial |
Allow partial unrolling (unrolling of loops to expand the size of the loop body, not only to eliminate small constant-trip-count loops).
Definition at line 587 of file TargetTransformInfo.h.
Referenced by llvm::computeUnrollCount(), llvm::gatherUnrollingPreferences(), llvm::BasicTTIImplBase< T >::getUnrollingPreferences(), llvm::AArch64TTIImpl::getUnrollingPreferences(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), llvm::HexagonTTIImpl::getUnrollingPreferences(), llvm::NVPTXTTIImpl::getUnrollingPreferences(), llvm::PPCTTIImpl::getUnrollingPreferences(), llvm::RISCVTTIImpl::getUnrollingPreferences(), llvm::SystemZTTIImpl::getUnrollingPreferences(), llvm::WebAssemblyTTIImpl::getUnrollingPreferences(), shouldPartialUnroll(), and tryToUnrollLoop().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::PartialOptSizeThreshold |
The cost threshold for the unrolled loop when optimizing for size, like OptSizeThreshold, but used for partial/runtime unrolling (set to UINT_MAX to disable).
Definition at line 559 of file TargetTransformInfo.h.
Referenced by computeHeuristicUnrollFactor(), llvm::gatherUnrollingPreferences(), llvm::BasicTTIImplBase< T >::getUnrollingPreferences(), llvm::AArch64TTIImpl::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), llvm::RISCVTTIImpl::getUnrollingPreferences(), and llvm::WebAssemblyTTIImpl::getUnrollingPreferences().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::PartialThreshold |
The cost threshold for the unrolled loop, like Threshold, but used for partial/runtime unrolling (set to UINT_MAX to disable).
Definition at line 555 of file TargetTransformInfo.h.
Referenced by computeHeuristicUnrollFactor(), llvm::computeUnrollCount(), llvm::gatherUnrollingPreferences(), llvm::BasicTTIImplBase< T >::getUnrollingPreferences(), llvm::AArch64TTIImpl::getUnrollingPreferences(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), llvm::NVPTXTTIImpl::getUnrollingPreferences(), llvm::SystemZTTIImpl::getUnrollingPreferences(), llvm::WebAssemblyTTIImpl::getUnrollingPreferences(), shouldPartialUnroll(), and tryToUnrollLoop().
bool llvm::TargetTransformInfo::UnrollingPreferences::Runtime |
Allow runtime unrolling (unrolling of loops to expand the size of the loop body even when the number of loop iterations is not known at compile time).
Definition at line 591 of file TargetTransformInfo.h.
Referenced by computeUnrollAndJamCount(), llvm::computeUnrollCount(), llvm::gatherUnrollingPreferences(), getAppleRuntimeUnrollPreferences(), llvm::BasicTTIImplBase< T >::getUnrollingPreferences(), llvm::AArch64TTIImpl::getUnrollingPreferences(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), llvm::HexagonTTIImpl::getUnrollingPreferences(), llvm::NVPTXTTIImpl::getUnrollingPreferences(), llvm::PPCTTIImpl::getUnrollingPreferences(), llvm::RISCVTTIImpl::getUnrollingPreferences(), llvm::SystemZTTIImpl::getUnrollingPreferences(), llvm::WebAssemblyTTIImpl::getUnrollingPreferences(), and tryToUnrollLoop().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::SCEVExpansionBudget |
Don't allow runtime unrolling if expanding the trip count takes more than SCEVExpansionBudget.
Definition at line 618 of file TargetTransformInfo.h.
Referenced by llvm::gatherUnrollingPreferences(), getAppleRuntimeUnrollPreferences(), and tryToUnrollLoop().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::Threshold |
The cost threshold for the unrolled loop.
Should be relative to the getInstructionCost values returned by this API, and the expectation is that the unrolled loop's instructions when run through that interface should not exceed this cost. However, this is only an estimate. Also, specific loops may be unrolled even with a cost above this threshold if deemed profitable. Set this to UINT_MAX to disable the loop body cost restriction.
Definition at line 538 of file TargetTransformInfo.h.
Referenced by computeHeuristicUnrollFactor(), computeUnrollAndJamCount(), llvm::computeUnrollCount(), llvm::gatherUnrollingPreferences(), llvm::AMDGPUTTIImpl::getUnrollingPreferences(), llvm::NVPTXTTIImpl::getUnrollingPreferences(), shouldFullUnroll(), shouldPragmaUnroll(), and tryToUnrollLoop().
bool llvm::TargetTransformInfo::UnrollingPreferences::UnrollAndJam |
Allow unroll and jam. Used to enable unroll and jam for the target.
Definition at line 605 of file TargetTransformInfo.h.
Referenced by llvm::gatherUnrollingPreferences(), llvm::AArch64TTIImpl::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), llvm::RISCVTTIImpl::getUnrollingPreferences(), and tryToUnrollAndJamLoop().
unsigned llvm::TargetTransformInfo::UnrollingPreferences::UnrollAndJamInnerLoopThreshold |
Threshold for unroll and jam, for inner loop size.
The 'Threshold' value above is used during unroll and jam for the outer loop size. This value is used in the same manner to limit the size of the inner loop.
Definition at line 610 of file TargetTransformInfo.h.
Referenced by computeUnrollAndJamCount(), llvm::gatherUnrollingPreferences(), llvm::AArch64TTIImpl::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), and tryToUnrollAndJamLoop().
bool llvm::TargetTransformInfo::UnrollingPreferences::UnrollRemainder |
Allow unrolling of all the iterations of the runtime loop remainder.
Definition at line 603 of file TargetTransformInfo.h.
Referenced by llvm::gatherUnrollingPreferences(), llvm::AArch64TTIImpl::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), llvm::RISCVTTIImpl::getUnrollingPreferences(), tryToUnrollAndJamLoop(), and tryToUnrollLoop().
bool llvm::TargetTransformInfo::UnrollingPreferences::UnrollVectorizedLoop = false |
Don't disable runtime unroll for the loops which were vectorized.
Definition at line 615 of file TargetTransformInfo.h.
Referenced by llvm::LoopVectorizationPlanner::executePlan(), and llvm::AMDGPUTTIImpl::getUnrollingPreferences().
bool llvm::TargetTransformInfo::UnrollingPreferences::UpperBound |
Allow using trip count upper bound to unroll loops.
Definition at line 601 of file TargetTransformInfo.h.
Referenced by llvm::computeUnrollCount(), llvm::gatherUnrollingPreferences(), llvm::BasicTTIImplBase< T >::getUnrollingPreferences(), llvm::AArch64TTIImpl::getUnrollingPreferences(), llvm::ARMTTIImpl::getUnrollingPreferences(), llvm::RISCVTTIImpl::getUnrollingPreferences(), and llvm::WebAssemblyTTIImpl::getUnrollingPreferences().