|
tvm
|
Rewrite-rule based simplifier. More...
#include <analyzer.h>
Public Member Functions | |
| TVM_TIRX_DLL PrimExpr | operator() (const PrimExpr &expr) |
| Simplify an expression under the current premises. | |
| TVM_TIRX_DLL CompareResult | TryCompare (const PrimExpr &lhs, const PrimExpr &rhs) |
| Compare signed integer expressions using active premises and constant offsets. | |
| TVM_TIRX_DLL ffi::ObjectRef | GetStatsCounters () const |
| Read cumulative rewrite statistics. | |
| TVM_TIRX_DLL void | ResetStatsCounters () |
| Clear cumulative rewrite counters without changing facts or the rewrite limit. | |
| TVM_TIRX_DLL void | SetMaximumRewriteSteps (int64_t maximum) |
| Set the maximum allowed cumulative number of successful rewrites. | |
Friends | |
| class | AnalyzerObj |
| class | CanonicalSimplifier |
Rewrite-rule based simplifier.
| TVM_TIRX_DLL ffi::ObjectRef tvm::sym::RewriteSimplifier::GetStatsCounters | ( | ) | const |
Read cumulative rewrite statistics.
| TVM_TIRX_DLL PrimExpr tvm::sym::RewriteSimplifier::operator() | ( | const PrimExpr & | expr | ) |
Simplify an expression under the current premises.
| expr | The expression to simplify. |
| TVM_TIRX_DLL void tvm::sym::RewriteSimplifier::ResetStatsCounters | ( | ) |
Clear cumulative rewrite counters without changing facts or the rewrite limit.
| TVM_TIRX_DLL void tvm::sym::RewriteSimplifier::SetMaximumRewriteSteps | ( | int64_t | maximum | ) |
Set the maximum allowed cumulative number of successful rewrites.
By default, the simplifier may perform as many steps as are required. If a positive limit is set, then the simplifier will throw an exception when exceeding that number of rewrite steps. This allows tests to guard against performance regressions.
Note: To maintain accurate usage counters, Analyzer instances should be re-used wherever possible. For example, TIR transformations should declare a single Analyzer that is used throughout the pass. Internal helpers may borrow its AnalyzerObj*.
The limit applies to the cumulative counter, not separately to each query. ResetStatsCounters starts a new accounting interval.
| maximum | Positive rewrite limit, or a nonpositive value for no limit. |
| TVM_TIRX_DLL CompareResult tvm::sym::RewriteSimplifier::TryCompare | ( | const PrimExpr & | lhs, |
| const PrimExpr & | rhs | ||
| ) |
Compare signed integer expressions using active premises and constant offsets.
| lhs | The left-hand side of the comparison. |
| rhs | The right-hand side of the comparison. |
|
friend |
|
friend |