Polly 20.0.0git
|
Scoped limit of ISL operations. More...
#include <GICHelper.h>
Public Member Functions | |
IslMaxOperationsGuard (isl_ctx *IslCtx, unsigned long LocalMaxOps, bool AutoEnter=true) | |
Enter a max operations scope. | |
IslQuotaScope | enter (bool AllowReturnNull=true) |
Enter a scope that can handle out-of-quota errors. | |
bool | hasQuotaExceeded () const |
Return whether the current quota has exceeded. | |
Private Attributes | |
isl_ctx * | IslCtx |
The ISL context to set the operations limit. | |
unsigned long | LocalMaxOps |
Maximum number of operations for the scope. | |
IslQuotaScope | TopLevelScope |
When AutoEnter is enabled, holds the IslQuotaScope object. | |
Scoped limit of ISL operations.
Limits the number of ISL operations during the lifetime of this object. The idea is to use this as an RAII guard for the scope where the code is aware that ISL can return errors even when all input is valid. After leaving the scope, it will return to the error setting as it was before. That also means that the error setting should not be changed while in that scope.
Such scopes are not allowed to be nested because the previous operations counter cannot be reset to the previous state, or one that adds the operations while being in the nested scope. Use therefore is only allowed while currently a no operations-limit is active.
Definition at line 424 of file GICHelper.h.
|
inline |
Enter a max operations scope.
IslCtx | The ISL context to set the operations limit for. |
LocalMaxOps | Maximum number of operations allowed in the scope. If set to zero, no operations limit is enforced. |
AutoEnter | If true, automatically enters an IslQuotaScope such that isl operations may return quota errors immediately. If false, only starts the operations counter, but isl does not return quota errors before calling enter(). |
Definition at line 449 of file GICHelper.h.
References assert, enter(), isl_ctx_get_max_operations(), isl_ctx_reset_error(), isl_ctx_reset_operations(), IslCtx, LocalMaxOps, and TopLevelScope.
|
inline |
Enter a scope that can handle out-of-quota errors.
AllowReturnNull | Whether the scoped code can handle out-of-quota errors. If false, returns a dummy scope object that does nothing. |
Definition at line 477 of file GICHelper.h.
References IslCtx, and LocalMaxOps.
Referenced by IslMaxOperationsGuard().
|
inline |
Return whether the current quota has exceeded.
Definition at line 483 of file GICHelper.h.
References isl_ctx_last_error(), isl_error_quota, and IslCtx.
|
private |
The ISL context to set the operations limit.
If set to nullptr, there is no need for any action at the end of the scope.
Definition at line 430 of file GICHelper.h.
Referenced by enter(), hasQuotaExceeded(), and IslMaxOperationsGuard().
|
private |
Maximum number of operations for the scope.
Definition at line 433 of file GICHelper.h.
Referenced by enter(), and IslMaxOperationsGuard().
|
private |
When AutoEnter is enabled, holds the IslQuotaScope object.
Definition at line 436 of file GICHelper.h.
Referenced by IslMaxOperationsGuard().