25 #ifndef TVM_TIR_EXPR_H_
26 #define TVM_TIR_EXPR_H_
28 #include <tvm/ffi/container/array.h>
29 #include <tvm/ffi/container/map.h>
30 #include <tvm/ffi/dtype.h>
31 #include <tvm/ffi/string.h>
44 #include <unordered_map>
59 namespace refl = tvm::ffi::reflection;
86 namespace refl = tvm::ffi::reflection;
108 template <
typename T>
116 namespace refl = tvm::ffi::reflection;
117 refl::ObjectDef<T>().def_ro(
"a", &T::a).def_ro(
"b", &T::b);
224 static constexpr
const char*
_type_key =
"tirx.FloorDiv";
242 static constexpr
const char*
_type_key =
"tirx.FloorMod";
297 template <
typename T>
305 namespace refl = tvm::ffi::reflection;
306 refl::ObjectDef<T>().def_ro(
"a", &T::a).def_ro(
"b", &T::b);
429 namespace refl = tvm::ffi::reflection;
455 namespace refl = tvm::ffi::reflection;
479 namespace refl = tvm::ffi::reflection;
480 refl::ObjectDef<NotNode>().def_ro(
"a", &
NotNode::a);
513 namespace refl = tvm::ffi::reflection;
514 refl::ObjectDef<SelectNode>()
554 namespace refl = tvm::ffi::reflection;
555 refl::ObjectDef<BufferLoadNode>()
572 void LegalizeDType();
586 ffi::Optional<PrimExpr> predicate = std::nullopt,
Span span =
Span());
608 namespace refl = tvm::ffi::reflection;
609 refl::ObjectDef<ProducerLoadNode>()
648 namespace refl = tvm::ffi::reflection;
649 refl::ObjectDef<RampNode>()
677 namespace refl = tvm::ffi::reflection;
678 refl::ObjectDef<BroadcastNode>()
709 namespace refl = tvm::ffi::reflection;
710 refl::ObjectDef<LetNode>()
712 .def_ro(
"var", &
LetNode::var, refl::AttachFieldFlag::SEqHashDefRecursive())
743 namespace refl = tvm::ffi::reflection;
744 refl::ObjectDef<ShuffleNode>()
757 TVM_DLL
Shuffle(ffi::Array<PrimExpr> vectors, ffi::Array<PrimExpr> indices,
Span span =
Span());
786 ffi::Array<PrimExpr>
operator()(ffi::Array<PrimExpr> a, ffi::Array<PrimExpr> b)
const;
794 namespace refl = tvm::ffi::reflection;
795 refl::ObjectDef<CommReducerNode>()
813 TVM_DLL
CommReducer(ffi::Array<PrimVar> lhs, ffi::Array<PrimVar> rhs, ffi::Array<PrimExpr> result,
814 ffi::Array<PrimExpr> identity_element,
Span span =
Span());
838 namespace refl = tvm::ffi::reflection;
839 refl::ObjectDef<ReduceNode>()
857 PrimExpr condition,
int value_index, ffi::Array<PrimExpr> init,
873 template <
typename K,
typename V>
875 std::unordered_map<K, V>
ret;
876 for (
auto kv : dmap) {
877 ret[kv.first] = kv.second;
886 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::StringImmNode> =
true;
888 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::CastNode> =
true;
890 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::AddNode> =
true;
892 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::SubNode> =
true;
894 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::MulNode> =
true;
896 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::DivNode> =
true;
898 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::ModNode> =
true;
900 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::FloorDivNode> =
true;
902 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::FloorModNode> =
true;
904 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::MinNode> =
true;
906 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::MaxNode> =
true;
908 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::EQNode> =
true;
910 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::NENode> =
true;
912 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::LTNode> =
true;
914 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::LENode> =
true;
916 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::GTNode> =
true;
918 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::GENode> =
true;
920 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::AndNode> =
true;
922 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::OrNode> =
true;
924 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::NotNode> =
true;
926 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::SelectNode> =
true;
928 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::BufferLoadNode> =
true;
930 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::ProducerLoadNode> =
true;
932 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::RampNode> =
true;
934 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::BroadcastNode> =
true;
936 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::LetNode> =
true;
938 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::ShuffleNode> =
true;
940 inline constexpr
bool object_ref_contains_v<PrimExpr, tirx::ReduceNode> =
true;
943 inline constexpr
bool use_default_type_traits_v<tvm::tirx::StringImm> =
false;
947 :
public ObjectRefWithFallbackTraitsBase<tvm::tirx::StringImm, ffi::String> {
Helpers for attribute objects.
Symbolic n-dimensional array, to represent a memory buffer.
Base type of all the expressions.
Definition: base_expr.h:276
Constant floating point literals in the program.
Definition: expr.h:424
Constant integer literals in the program.
Definition: expr.h:361
Typed reference/view over any Expr whose ExprNode::ty is PrimType.
Definition: base_expr.h:354
Definition: base_expr.h:113
Definition: source_map.h:111
a + b
Definition: expr.h:125
static constexpr const char * _type_key
Definition: expr.h:127
Managed reference to AddNode.
Definition: expr.h:134
static constexpr bool _type_container_is_exact
Definition: expr.h:138
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Add, PrimExpr, AddNode)
Add(PrimExpr a, PrimExpr b, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(AddNode)
a && b
Definition: expr.h:422
PrimExpr a
The left operand.
Definition: expr.h:425
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.And", AndNode, ExprNode)
PrimExpr b
The right operand.
Definition: expr.h:427
static void RegisterReflection()
Definition: expr.h:428
Managed reference to AndNode.
Definition: expr.h:439
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(And, PrimExpr, AndNode)
static constexpr bool _type_container_is_exact
Definition: expr.h:443
And(PrimExpr a, PrimExpr b, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(AndNode)
Base template to implement binary ops.
Definition: expr.h:109
static constexpr const int _type_child_slots
Definition: expr.h:119
PrimExpr b
The right operand.
Definition: expr.h:114
static constexpr const bool _type_final
Definition: expr.h:120
TVM_FFI_DECLARE_OBJECT_INFO_PREDEFINED_TYPE_KEY(T, ExprNode)
static void RegisterReflection()
Definition: expr.h:115
PrimExpr a
The left operand.
Definition: expr.h:112
Create a vector where all the elements are value.
Definition: expr.h:670
PrimExpr value
The base value.
Definition: expr.h:673
static void RegisterReflection()
Definition: expr.h:676
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.Broadcast", BroadcastNode, ExprNode)
PrimExpr lanes
The number of lanes.
Definition: expr.h:675
Managed reference to BroadcastNode.
Definition: expr.h:689
TVM_DEFINE_OBJECT_REF_COW_METHOD(BroadcastNode)
Broadcast(PrimExpr value, PrimExpr lanes, Span span=Span())
static constexpr bool _type_container_is_exact
Definition: expr.h:693
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Broadcast, PrimExpr, BroadcastNode)
Load value from the high dimension buffer.
Definition: expr.h:545
Buffer buffer
The buffer variable.
Definition: expr.h:548
friend class VectorTypeRewriter
Definition: expr.h:575
ffi::Optional< PrimExpr > predicate
The predicate mask for loading values.
Definition: expr.h:552
friend class CustomDatatypesLowerer
Definition: expr.h:574
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.BufferLoad", BufferLoadNode, ExprNode)
friend class Vectorizer
Definition: expr.h:576
static void RegisterReflection()
Definition: expr.h:553
ffi::Array< PrimExpr > indices
The indices location to be loaded.
Definition: expr.h:550
Managed reference to BufferLoadNode.
Definition: expr.h:583
TVM_DEFINE_OBJECT_REF_COW_METHOD(BufferLoadNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(BufferLoad, PrimExpr, BufferLoadNode)
static constexpr bool _type_container_is_exact
Definition: expr.h:588
BufferLoad(Buffer buffer, ffi::Array< PrimExpr > indices, ffi::Optional< PrimExpr > predicate=std::nullopt, Span span=Span())
Buffer is a symbolic n-darray structure. It is a composition of primitive symbolic types,...
Definition: buffer.h:187
Cast value from one data type to another.
Definition: expr.h:81
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.Cast", CastNode, ExprNode)
PrimExpr value
Original data type.
Definition: expr.h:84
static void RegisterReflection()
Definition: expr.h:85
Managed reference to CastNode.
Definition: expr.h:96
Cast(PrimType value_ty, PrimExpr value, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(CastNode)
static constexpr bool _type_container_is_exact
Definition: expr.h:100
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Cast, PrimExpr, CastNode)
Base template to implement comparison ops.
Definition: expr.h:298
static constexpr const bool _type_final
Definition: expr.h:309
PrimExpr a
The left operand.
Definition: expr.h:301
static constexpr const int _type_child_slots
Definition: expr.h:308
static void RegisterReflection()
Definition: expr.h:304
PrimExpr b
The right operand.
Definition: expr.h:303
TVM_FFI_DECLARE_OBJECT_INFO_PREDEFINED_TYPE_KEY(T, ExprNode)
A commutative reducer node to represent a commutative binary operator with identity element.
Definition: expr.h:771
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind
Definition: expr.h:803
ffi::Array< PrimVar > rhs
The right argument of reducer.
Definition: expr.h:776
Span span
Span that points to the original source code. Reserved debug information.
Definition: expr.h:791
ffi::Array< PrimExpr > identity_element
The identity element of reducer, which leaves other elements unchanged when combined with it,...
Definition: expr.h:784
static void RegisterReflection()
Definition: expr.h:793
ffi::Array< PrimExpr > operator()(ffi::Array< PrimExpr > a, ffi::Array< PrimExpr > b) const
Function call operator to combine a and b.
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.CommReducer", CommReducerNode, ffi::Object)
ffi::Array< PrimVar > lhs
The left argument of reducer.
Definition: expr.h:774
ffi::Array< PrimExpr > result
The result of reducer.
Definition: expr.h:778
Managed reference to CommReducerNode.
Definition: expr.h:811
CommReducer(ffi::Array< PrimVar > lhs, ffi::Array< PrimVar > rhs, ffi::Array< PrimExpr > result, ffi::Array< PrimExpr > identity_element, Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(CommReducer, ffi::ObjectRef, CommReducerNode)
Managed reference to DataProducerNode.
Definition: buffer.h:350
a / b in the C semnatics.
Definition: expr.h:183
static constexpr const char * _type_key
Definition: expr.h:185
Managed reference to DivNode.
Definition: expr.h:192
TVM_DEFINE_OBJECT_REF_COW_METHOD(DivNode)
Div(PrimExpr a, PrimExpr b, Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Div, PrimExpr, DivNode)
static constexpr bool _type_container_is_exact
Definition: expr.h:196
a == b
Definition: expr.h:314
static constexpr const char * _type_key
Definition: expr.h:316
Managed reference to EQNode.
Definition: expr.h:323
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(EQ, PrimExpr, EQNode)
static constexpr bool _type_container_is_exact
Definition: expr.h:327
TVM_DEFINE_OBJECT_REF_COW_METHOD(EQNode)
EQ(PrimExpr a, PrimExpr b, Span span=Span())
Floor division, floor(a/b)
Definition: expr.h:222
static constexpr const char * _type_key
Definition: expr.h:224
Managed reference to FloorDivNode.
Definition: expr.h:231
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(FloorDiv, PrimExpr, FloorDivNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(FloorDivNode)
static constexpr bool _type_container_is_exact
Definition: expr.h:235
FloorDiv(PrimExpr a, PrimExpr b, Span span=Span())
The remainder of the floordiv.
Definition: expr.h:240
static constexpr const char * _type_key
Definition: expr.h:242
Managed reference to FloorModNode.
Definition: expr.h:249
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(FloorMod, PrimExpr, FloorModNode)
static constexpr bool _type_container_is_exact
Definition: expr.h:253
FloorMod(PrimExpr a, PrimExpr b, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(FloorModNode)
a >= b
Definition: expr.h:404
static constexpr const char * _type_key
Definition: expr.h:406
Managed reference to GENode.
Definition: expr.h:413
GE(PrimExpr a, PrimExpr b, Span span=Span())
static constexpr bool _type_container_is_exact
Definition: expr.h:417
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(GE, PrimExpr, GENode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(GENode)
a > b
Definition: expr.h:386
static constexpr const char * _type_key
Definition: expr.h:388
Managed reference to GTNode.
Definition: expr.h:395
TVM_DEFINE_OBJECT_REF_COW_METHOD(GTNode)
static constexpr bool _type_container_is_exact
Definition: expr.h:399
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(GT, PrimExpr, GTNode)
GT(PrimExpr a, PrimExpr b, Span span=Span())
Iteration Variable, represents an iteration over an integer interval.
Definition: var.h:274
Managed reference to LENode.
Definition: expr.h:377
TVM_DEFINE_OBJECT_REF_COW_METHOD(LENode)
static constexpr bool _type_container_is_exact
Definition: expr.h:381
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(LE, PrimExpr, LENode)
LE(PrimExpr a, PrimExpr b, Span span=Span())
a < b
Definition: expr.h:350
static constexpr const char * _type_key
Definition: expr.h:352
Managed reference to LTNode.
Definition: expr.h:359
TVM_DEFINE_OBJECT_REF_COW_METHOD(LTNode)
static constexpr bool _type_container_is_exact
Definition: expr.h:363
LT(PrimExpr a, PrimExpr b, Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(LT, PrimExpr, LTNode)
Let binding. Bind var to value then evaluate body.
Definition: expr.h:700
PrimExpr body
The result expression.
Definition: expr.h:707
PrimExpr value
The value to be binded.
Definition: expr.h:705
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.Let", LetNode, ExprNode)
static void RegisterReflection()
Definition: expr.h:708
Var var
The variable.
Definition: expr.h:703
Managed reference to LetNode.
Definition: expr.h:723
static constexpr bool _type_container_is_exact
Definition: expr.h:727
TVM_DEFINE_OBJECT_REF_COW_METHOD(LetNode)
Let(Var var, PrimExpr value, PrimExpr body, Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Let, PrimExpr, LetNode)
max(a, b)
Definition: expr.h:276
static constexpr const char * _type_key
Definition: expr.h:278
Managed reference to MaxNode.
Definition: expr.h:285
TVM_DEFINE_OBJECT_REF_COW_METHOD(MaxNode)
Max(PrimExpr a, PrimExpr b, Span span=Span())
static constexpr bool _type_container_is_exact
Definition: expr.h:289
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Max, PrimExpr, MaxNode)
min(a, b)
Definition: expr.h:258
static constexpr const char * _type_key
Definition: expr.h:260
Managed reference to MinNode.
Definition: expr.h:267
TVM_DEFINE_OBJECT_REF_COW_METHOD(MinNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Min, PrimExpr, MinNode)
Min(PrimExpr a, PrimExpr b, Span span=Span())
static constexpr bool _type_container_is_exact
Definition: expr.h:271
a % b in the C semnatics.
Definition: expr.h:204
static constexpr const char * _type_key
Definition: expr.h:206
Managed reference to ModNode.
Definition: expr.h:213
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Mod, PrimExpr, ModNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(ModNode)
Mod(PrimExpr a, PrimExpr b, Span span=Span())
static constexpr bool _type_container_is_exact
Definition: expr.h:217
a * b
Definition: expr.h:162
static constexpr const char * _type_key
Definition: expr.h:164
Managed reference to MulNode.
Definition: expr.h:171
Mul(PrimExpr a, PrimExpr b, Span span=Span())
static constexpr bool _type_container_is_exact
Definition: expr.h:175
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Mul, PrimExpr, MulNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(MulNode)
a != b
Definition: expr.h:332
static constexpr const char * _type_key
Definition: expr.h:334
Managed reference to NENode.
Definition: expr.h:341
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(NE, PrimExpr, NENode)
static constexpr bool _type_container_is_exact
Definition: expr.h:345
NE(PrimExpr a, PrimExpr b, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(NENode)
static void RegisterReflection()
Definition: expr.h:478
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.Not", NotNode, ExprNode)
PrimExpr a
The input operand.
Definition: expr.h:477
Managed reference to NotNode.
Definition: expr.h:489
static constexpr bool _type_container_is_exact
Definition: expr.h:493
Not(PrimExpr a, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(NotNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Not, PrimExpr, NotNode)
a || b
Definition: expr.h:448
PrimExpr b
The right operand.
Definition: expr.h:453
static void RegisterReflection()
Definition: expr.h:454
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.Or", OrNode, ExprNode)
PrimExpr a
The left operand.
Definition: expr.h:451
Managed reference to OrNode.
Definition: expr.h:465
Or(PrimExpr a, PrimExpr b, Span span=Span())
static constexpr bool _type_container_is_exact
Definition: expr.h:469
TVM_DEFINE_OBJECT_REF_COW_METHOD(OrNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Or, PrimExpr, OrNode)
Load value from the result produced by the producer.
Definition: expr.h:601
ffi::Array< PrimExpr > indices
The location arguments.
Definition: expr.h:606
DataProducer producer
The buffer producer.
Definition: expr.h:604
static void RegisterReflection()
Definition: expr.h:607
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.ProducerLoad", ProducerLoadNode, ExprNode)
Managed reference to ProducerLoadNode.
Definition: expr.h:620
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(ProducerLoad, PrimExpr, ProducerLoadNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(ProducerLoadNode)
ProducerLoad(DataProducer producer, ffi::Array< PrimExpr > indices, Span span=Span())
static constexpr bool _type_container_is_exact
Definition: expr.h:626
Construct a vector with lanes elements where its i-th element equals base + i * stride....
Definition: expr.h:639
PrimExpr lanes
Total number of lanes.
Definition: expr.h:646
PrimExpr base
The base value.
Definition: expr.h:642
static void RegisterReflection()
Definition: expr.h:647
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.Ramp", RampNode, ExprNode)
PrimExpr stride
The stride of each step.
Definition: expr.h:644
Managed reference to RampNode.
Definition: expr.h:661
TVM_DEFINE_OBJECT_REF_COW_METHOD(RampNode)
Ramp(PrimExpr base, PrimExpr stride, PrimExpr lanes, Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Ramp, PrimExpr, RampNode)
static constexpr bool _type_container_is_exact
Definition: expr.h:665
Reduction operator.
Definition: expr.h:820
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.Reduce", ReduceNode, ExprNode)
ffi::Array< PrimExpr > source
The source operand.
Definition: expr.h:825
ffi::Array< IterVar > axis
The reduction axis.
Definition: expr.h:829
CommReducer combiner
The commutative combiner.
Definition: expr.h:823
static void RegisterReflection()
Definition: expr.h:837
PrimExpr condition
Predicate on the reduction Only add the body to reduction if condition is true.
Definition: expr.h:834
int value_index
the index of this reduce node
Definition: expr.h:836
ffi::Array< PrimExpr > init
The init operand.
Definition: expr.h:827
Managed reference to ReduceNode.
Definition: expr.h:854
static constexpr bool _type_container_is_exact
Definition: expr.h:861
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Reduce, PrimExpr, ReduceNode)
Reduce(CommReducer combiner, ffi::Array< PrimExpr > src, ffi::Array< IterVar > rdom, PrimExpr condition, int value_index, ffi::Array< PrimExpr > init, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(ReduceNode)
return true_value if condition is true, otherwise return false_value.
Definition: expr.h:504
static void RegisterReflection()
Definition: expr.h:512
PrimExpr false_value
value to be returned when condition is false.
Definition: expr.h:511
PrimExpr true_value
value to be returned when condition is true.
Definition: expr.h:509
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.Select", SelectNode, ExprNode)
PrimExpr condition
The condition.
Definition: expr.h:507
Managed reference to SelectNode.
Definition: expr.h:526
static constexpr bool _type_container_is_exact
Definition: expr.h:531
Select(PrimExpr condition, PrimExpr true_value, PrimExpr false_value, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(SelectNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Select, PrimExpr, SelectNode)
Shuffle instruction. vec = concat(vectors) result = (vec[indices[0]], vec[indices[1]] ....
Definition: expr.h:736
ffi::Array< PrimExpr > indices
The indices of each element.
Definition: expr.h:741
ffi::Array< PrimExpr > vectors
the input vectors.
Definition: expr.h:739
static void RegisterReflection()
Definition: expr.h:742
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.Shuffle", ShuffleNode, ExprNode)
Managed reference to ShuffleNode.
Definition: expr.h:755
static PrimExpr ExtractElement(PrimExpr vector, int index, Span span=Span())
static constexpr bool _type_container_is_exact
Definition: expr.h:762
static PrimExpr Concat(ffi::Array< PrimExpr > vectors, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(ShuffleNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Shuffle, PrimExpr, ShuffleNode)
Shuffle(ffi::Array< PrimExpr > vectors, ffi::Array< PrimExpr > indices, Span span=Span())
ffi::String constants, only used in asserts.
Definition: expr.h:54
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.StringImm", StringImmNode, ExprNode)
ffi::String value
The constant value content.
Definition: expr.h:57
static void RegisterReflection()
Definition: expr.h:58
Managed reference to StringImmNode.
Definition: expr.h:69
static constexpr bool _type_container_is_exact
Definition: expr.h:73
TVM_DEFINE_OBJECT_REF_COW_METHOD(StringImmNode)
StringImm(ffi::String value, Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(StringImm, PrimExpr, StringImmNode)
a - b
Definition: expr.h:143
static constexpr const char * _type_key
Definition: expr.h:145
Managed reference to SubNode.
Definition: expr.h:152
static constexpr bool _type_container_is_exact
Definition: expr.h:157
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Sub, PrimExpr, SubNode)
Sub(PrimExpr a, PrimExpr b, Span span=Span())
TVM_DEFINE_OBJECT_REF_COW_METHOD(SubNode)
a named variable in TIR
Definition: var.h:68
Copy-on-write helper macro for IR ffi::ObjectRef types.
PrimVar var(std::string name_hint, PrimType t=PrimType::Int(32))
Construct a new Var expression.
tvm::FloatImmNode FloatImmNode
Definition: expr.h:51
tvm::IntImmNode IntImmNode
Definition: expr.h:50
std::unordered_map< K, V > as_unordered_map(const ffi::Map< K, V > &dmap)
Definition: expr.h:874
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:40
PrimExpr ret(PrimExpr value, Span span=Span())
Return the value.
Defines the Functor data structures.
static TVM_FFI_INLINE tvm::tirx::StringImm ConvertFallbackValue(ffi::String value)
Definition: expr.h:948
a <= b
Definition: expr.h:368
static constexpr const char * _type_key
Definition: expr.h:370