tvm
Loading...
Searching...
No Matches
stmt.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
22#ifndef TVM_TIRX_STMT_H_
23#define TVM_TIRX_STMT_H_
24
25#include <tvm/ir/stmt.h>
26#include <tvm/tirx/expr.h>
28
29namespace tvm {
30namespace tirx {
31
33inline bool IsNoOp(const Stmt& stmt) {
34 if (!stmt.defined()) return true;
35 if (const auto* op = stmt.as<EvaluateNode>()) return op->value.as<IntImmNode>() != nullptr;
36 if (const auto* op = stmt.as<SeqStmtNode>()) return op->seq.empty();
37 return false;
38}
39
41namespace attr {
42constexpr const char* kPragmaUnroll = "pragma_unroll";
43
44constexpr const char* kDisableUnroll = "disable_unroll";
45
51constexpr const char* kAutoUnrollMaxStep = "auto_unroll_max_step";
57constexpr const char* kUnrollExplicit = "unroll_explicit";
59constexpr const char* kVolatile = "tirx.volatile";
61constexpr const char* kTensorDataAlignment = "tensor_data_alignment";
62
63} // namespace attr
64
65} // namespace tirx
66} // namespace tvm
67#endif // TVM_TIRX_STMT_H_
Evaluates an expression. This is mostly used for putting a Call node into Stmt.
Definition stmt.h:352
Constant integer literals in the program.
Definition expr.h:135
The container of seq statement. Represent a sequence of statements.
Definition stmt.h:75
Container of all statements.
Definition stmt.h:62
Statements shared across IR dialects.
constexpr const char * kDisableUnroll
Definition stmt.h:44
constexpr const char * kPragmaUnroll
Definition stmt.h:42
constexpr const char * kUnrollExplicit
For annotation: expand unrolled bodies instead of preserving unrolled loops.
Definition stmt.h:57
constexpr const char * kAutoUnrollMaxStep
For annotation: maximum work for automatic unrolling.
Definition stmt.h:51
constexpr const char * kVolatile
Annotation key on AllocTensor marking the allocation as volatile.
Definition stmt.h:59
constexpr const char * kTensorDataAlignment
Mark tensor initial addr alignment in bytes.
Definition stmt.h:61
bool IsNoOp(const Stmt &stmt)
Whether stmt is undefined, an integer Evaluate, or an empty sequence.
Definition stmt.h:33
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
TIRx tensor expressions and construction helpers.