25#ifndef TVM_IR_PRIM_EXPR_H_
26#define TVM_IR_PRIM_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>
43#include <unordered_map>
64 namespace refl = tvm::ffi::reflection;
77 explicit Cast(ffi::ObjectPtr<CastNode> node) :
PrimExpr(std::move(node)) {}
99 namespace refl = tvm::ffi::reflection;
100 refl::ObjectDef<T>().def_ro(
"a", &T::a).def_ro(
"b", &T::b);
121 explicit Add(ffi::ObjectPtr<AddNode> node) :
PrimExpr(std::move(node)) {}
174 static constexpr const char*
_type_key =
"prim.BitwiseAnd";
195 static constexpr const char*
_type_key =
"prim.BitwiseOr";
216 static constexpr const char*
_type_key =
"prim.BitwiseXor";
248 explicit Sub(ffi::ObjectPtr<SubNode> node) :
PrimExpr(std::move(node)) {}
269 explicit Mul(ffi::ObjectPtr<MulNode> node) :
PrimExpr(std::move(node)) {}
293 explicit Div(ffi::ObjectPtr<DivNode> node) :
PrimExpr(std::move(node)) {}
317 explicit Mod(ffi::ObjectPtr<ModNode> node) :
PrimExpr(std::move(node)) {}
328 static constexpr const char*
_type_key =
"prim.FloorDiv";
349 static constexpr const char*
_type_key =
"prim.FloorMod";
380 explicit Min(ffi::ObjectPtr<MinNode> node) :
PrimExpr(std::move(node)) {}
401 explicit Max(ffi::ObjectPtr<MaxNode> node) :
PrimExpr(std::move(node)) {}
423 namespace refl = tvm::ffi::reflection;
424 refl::ObjectDef<T>().def_ro(
"a", &T::a).def_ro(
"b", &T::b);
445 explicit EQ(ffi::ObjectPtr<EQNode> node) :
PrimExpr(std::move(node)) {}
466 explicit NE(ffi::ObjectPtr<NENode> node) :
PrimExpr(std::move(node)) {}
487 explicit LT(ffi::ObjectPtr<LTNode> node) :
PrimExpr(std::move(node)) {}
508 explicit LE(ffi::ObjectPtr<LENode> node) :
PrimExpr(std::move(node)) {}
529 explicit GT(ffi::ObjectPtr<GTNode> node) :
PrimExpr(std::move(node)) {}
550 explicit GE(ffi::ObjectPtr<GENode> node) :
PrimExpr(std::move(node)) {}
561 explicit AndNode(ffi::UnsafeInit tag) :
a(tag),
b(tag) {}
568 namespace refl = tvm::ffi::reflection;
581 explicit And(ffi::ObjectPtr<AndNode> node) :
PrimExpr(std::move(node)) {}
592 explicit OrNode(ffi::UnsafeInit tag) :
a(tag),
b(tag) {}
599 namespace refl = tvm::ffi::reflection;
612 explicit Or(ffi::ObjectPtr<OrNode> node) :
PrimExpr(std::move(node)) {}
628 namespace refl = tvm::ffi::reflection;
629 refl::ObjectDef<NotNode>().def_ro(
"a", &
NotNode::a);
641 explicit Not(ffi::ObjectPtr<NotNode> node) :
PrimExpr(std::move(node)) {}
657 namespace refl = tvm::ffi::reflection;
699 namespace refl = tvm::ffi::reflection;
700 refl::ObjectDef<SelectNode>()
740 namespace refl = tvm::ffi::reflection;
741 refl::ObjectDef<LetNode>()
742 .def_ro(
"var", &
LetNode::var, refl::AttachFieldFlag::SEqHashDefSimple())
756 explicit Let(ffi::ObjectPtr<LetNode> node) :
PrimExpr(std::move(node)) {}
771template <
typename K,
typename V>
773 std::unordered_map<K, V> ret;
774 for (
auto kv : dmap) {
775 ret[kv.first] = kv.second;
805inline constexpr bool object_ref_contains_v<PrimExpr, prim::CastNode> =
true;
807inline constexpr bool object_ref_contains_v<PrimExpr, prim::AddNode> =
true;
809inline constexpr bool object_ref_contains_v<PrimExpr, prim::BitwiseNotNode> =
true;
811inline constexpr bool object_ref_contains_v<PrimExpr, prim::BitwiseXorNode> =
true;
813inline constexpr bool object_ref_contains_v<PrimExpr, prim::BitwiseOrNode> =
true;
815inline constexpr bool object_ref_contains_v<PrimExpr, prim::BitwiseAndNode> =
true;
817inline constexpr bool object_ref_contains_v<PrimExpr, prim::RShiftNode> =
true;
819inline constexpr bool object_ref_contains_v<PrimExpr, prim::LShiftNode> =
true;
821inline constexpr bool object_ref_contains_v<PrimExpr, prim::SubNode> =
true;
823inline constexpr bool object_ref_contains_v<PrimExpr, prim::MulNode> =
true;
825inline constexpr bool object_ref_contains_v<PrimExpr, prim::DivNode> =
true;
827inline constexpr bool object_ref_contains_v<PrimExpr, prim::ModNode> =
true;
829inline constexpr bool object_ref_contains_v<PrimExpr, prim::FloorDivNode> =
true;
831inline constexpr bool object_ref_contains_v<PrimExpr, prim::FloorModNode> =
true;
833inline constexpr bool object_ref_contains_v<PrimExpr, prim::MinNode> =
true;
835inline constexpr bool object_ref_contains_v<PrimExpr, prim::MaxNode> =
true;
837inline constexpr bool object_ref_contains_v<PrimExpr, prim::EQNode> =
true;
839inline constexpr bool object_ref_contains_v<PrimExpr, prim::NENode> =
true;
841inline constexpr bool object_ref_contains_v<PrimExpr, prim::LTNode> =
true;
843inline constexpr bool object_ref_contains_v<PrimExpr, prim::LENode> =
true;
845inline constexpr bool object_ref_contains_v<PrimExpr, prim::GTNode> =
true;
847inline constexpr bool object_ref_contains_v<PrimExpr, prim::GENode> =
true;
849inline constexpr bool object_ref_contains_v<PrimExpr, prim::AndNode> =
true;
851inline constexpr bool object_ref_contains_v<PrimExpr, prim::OrNode> =
true;
853inline constexpr bool object_ref_contains_v<PrimExpr, prim::NotNode> =
true;
855inline constexpr bool object_ref_contains_v<PrimExpr, prim::SelectNode> =
true;
857inline constexpr bool object_ref_contains_v<PrimExpr, prim::RampNode> =
true;
859inline constexpr bool object_ref_contains_v<PrimExpr, prim::BroadcastNode> =
true;
861inline constexpr bool object_ref_contains_v<PrimExpr, prim::LetNode> =
true;
863inline constexpr bool object_ref_contains_v<PrimExpr, prim::ShuffleNode> =
true;
Helpers for attribute objects.
Base type of all the expressions.
Definition base_expr.h:324
Constant floating point literals in the program.
Definition expr.h:215
Constant integer literals in the program.
Definition expr.h:135
Non-nullable source-location metadata.
Definition location.h:91
Typed reference/view over any Expr whose ExprNode::ty is PrimType.
Definition base_expr.h:447
Definition base_expr.h:161
Reference to the shared immutable unknown location.
Definition location.h:105
Managed reference to VarNode.
Definition expr.h:714
a + b
Definition expr.h:108
static constexpr const char * _type_key
Definition expr.h:111
Managed reference to AddNode.
Definition expr.h:118
TVM_TIRX_DLL Add(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Add, PrimExpr, AddNode)
Add(ffi::ObjectPtr< AddNode > node)
Definition expr.h:121
static constexpr bool _type_container_is_exact
Definition expr.h:124
TVM_DEFINE_OBJECT_REF_COW_METHOD(AddNode)
a && b
Definition expr.h:558
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.And", AndNode, ExprNode)
PrimExpr b
The right operand.
Definition expr.h:566
AndNode(PrimExpr a, PrimExpr b)
Definition expr.h:560
AndNode(ffi::UnsafeInit tag)
Definition expr.h:561
static void RegisterReflection()
Definition expr.h:567
PrimExpr a
The left operand.
Definition expr.h:564
Managed reference to AndNode.
Definition expr.h:578
TVM_TIRX_DLL And(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_DEFINE_OBJECT_REF_COW_METHOD(AndNode)
static constexpr bool _type_container_is_exact
Definition expr.h:584
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(And, PrimExpr, AndNode)
And(ffi::ObjectPtr< AndNode > node)
Definition expr.h:581
Base template to implement binary ops.
Definition expr.h:89
BinaryOpNode(PrimExpr a, PrimExpr b)
Definition expr.h:91
static const constexpr int _type_child_slots
Definition expr.h:102
BinaryOpNode(ffi::UnsafeInit tag)
Definition expr.h:92
TVM_FFI_DECLARE_OBJECT_INFO_PREDEFINED_TYPE_KEY(T, ExprNode)
static void RegisterReflection()
Definition expr.h:98
PrimExpr a
The left operand.
Definition expr.h:95
PrimExpr b
The right operand.
Definition expr.h:97
static const constexpr bool _type_final
Definition expr.h:103
a & b
Definition expr.h:171
static constexpr const char * _type_key
Definition expr.h:174
Managed reference to BitwiseAndNode.
Definition expr.h:181
TVM_TIRX_DLL BitwiseAnd(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_DEFINE_OBJECT_REF_COW_METHOD(BitwiseAndNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(BitwiseAnd, PrimExpr, BitwiseAndNode)
static constexpr bool _type_container_is_exact
Definition expr.h:187
BitwiseAnd(ffi::ObjectPtr< BitwiseAndNode > node)
Definition expr.h:184
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.BitwiseNot", BitwiseNotNode, ExprNode)
PrimExpr a
The input operand.
Definition expr.h:655
BitwiseNotNode(PrimExpr a)
Definition expr.h:651
BitwiseNotNode(ffi::UnsafeInit tag)
Definition expr.h:652
static void RegisterReflection()
Definition expr.h:656
Managed reference to BitwiseNotNode.
Definition expr.h:667
TVM_TIRX_DLL BitwiseNot(PrimExpr a, Location loc=UnknownLoc())
TVM_DEFINE_OBJECT_REF_COW_METHOD(BitwiseNotNode)
static constexpr bool _type_container_is_exact
Definition expr.h:673
BitwiseNot(ffi::ObjectPtr< BitwiseNotNode > node)
Definition expr.h:670
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(BitwiseNot, PrimExpr, BitwiseNotNode)
a | b
Definition expr.h:192
static constexpr const char * _type_key
Definition expr.h:195
Managed reference to BitwiseOrNode.
Definition expr.h:202
BitwiseOr(ffi::ObjectPtr< BitwiseOrNode > node)
Definition expr.h:205
TVM_TIRX_DLL BitwiseOr(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(BitwiseOr, PrimExpr, BitwiseOrNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(BitwiseOrNode)
static constexpr bool _type_container_is_exact
Definition expr.h:208
a ^ b
Definition expr.h:213
static constexpr const char * _type_key
Definition expr.h:216
Managed reference to BitwiseXorNode.
Definition expr.h:223
static constexpr bool _type_container_is_exact
Definition expr.h:229
TVM_DEFINE_OBJECT_REF_COW_METHOD(BitwiseXorNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(BitwiseXor, PrimExpr, BitwiseXorNode)
BitwiseXor(ffi::ObjectPtr< BitwiseXorNode > node)
Definition expr.h:226
TVM_TIRX_DLL BitwiseXor(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
Cast value from one data type to another.
Definition expr.h:56
PrimExpr value
Original data type.
Definition expr.h:62
CastNode(PrimExpr value)
Definition expr.h:58
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.Cast", CastNode, ExprNode)
static void RegisterReflection()
Definition expr.h:63
CastNode(ffi::UnsafeInit tag)
Definition expr.h:59
Managed reference to CastNode.
Definition expr.h:74
static constexpr bool _type_container_is_exact
Definition expr.h:80
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Cast, PrimExpr, CastNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(CastNode)
TVM_TIRX_DLL Cast(PrimType value_ty, PrimExpr value, Location loc=UnknownLoc())
Cast(ffi::ObjectPtr< CastNode > node)
Definition expr.h:77
Base template to implement comparison ops.
Definition expr.h:413
static const constexpr bool _type_final
Definition expr.h:427
PrimExpr b
The right operand.
Definition expr.h:421
PrimExpr a
The left operand.
Definition expr.h:419
TVM_FFI_DECLARE_OBJECT_INFO_PREDEFINED_TYPE_KEY(T, ExprNode)
static void RegisterReflection()
Definition expr.h:422
CmpOpNode(PrimExpr a, PrimExpr b)
Definition expr.h:415
CmpOpNode(ffi::UnsafeInit tag)
Definition expr.h:416
static const constexpr int _type_child_slots
Definition expr.h:426
a / b in the C semnatics.
Definition expr.h:280
static constexpr const char * _type_key
Definition expr.h:283
Managed reference to DivNode.
Definition expr.h:290
Div(ffi::ObjectPtr< DivNode > node)
Definition expr.h:293
TVM_TIRX_DLL Div(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_DEFINE_OBJECT_REF_COW_METHOD(DivNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Div, PrimExpr, DivNode)
static constexpr bool _type_container_is_exact
Definition expr.h:296
a == b
Definition expr.h:432
static constexpr const char * _type_key
Definition expr.h:435
Managed reference to EQNode.
Definition expr.h:442
TVM_TIRX_DLL EQ(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(EQ, PrimExpr, EQNode)
EQ(ffi::ObjectPtr< EQNode > node)
Definition expr.h:445
static constexpr bool _type_container_is_exact
Definition expr.h:448
TVM_DEFINE_OBJECT_REF_COW_METHOD(EQNode)
Floor division, floor(a/b)
Definition expr.h:325
static constexpr const char * _type_key
Definition expr.h:328
Managed reference to FloorDivNode.
Definition expr.h:335
FloorDiv(ffi::ObjectPtr< FloorDivNode > node)
Definition expr.h:338
static constexpr bool _type_container_is_exact
Definition expr.h:341
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(FloorDiv, PrimExpr, FloorDivNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(FloorDivNode)
TVM_TIRX_DLL FloorDiv(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
The remainder of the floordiv.
Definition expr.h:346
static constexpr const char * _type_key
Definition expr.h:349
Managed reference to FloorModNode.
Definition expr.h:356
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(FloorMod, PrimExpr, FloorModNode)
TVM_TIRX_DLL FloorMod(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
FloorMod(ffi::ObjectPtr< FloorModNode > node)
Definition expr.h:359
static constexpr bool _type_container_is_exact
Definition expr.h:362
TVM_DEFINE_OBJECT_REF_COW_METHOD(FloorModNode)
a >= b
Definition expr.h:537
static constexpr const char * _type_key
Definition expr.h:540
Managed reference to GENode.
Definition expr.h:547
static constexpr bool _type_container_is_exact
Definition expr.h:553
TVM_DEFINE_OBJECT_REF_COW_METHOD(GENode)
GE(ffi::ObjectPtr< GENode > node)
Definition expr.h:550
TVM_TIRX_DLL GE(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(GE, PrimExpr, GENode)
a > b
Definition expr.h:516
static constexpr const char * _type_key
Definition expr.h:519
Managed reference to GTNode.
Definition expr.h:526
TVM_DEFINE_OBJECT_REF_COW_METHOD(GTNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(GT, PrimExpr, GTNode)
static constexpr bool _type_container_is_exact
Definition expr.h:532
TVM_TIRX_DLL GT(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
GT(ffi::ObjectPtr< GTNode > node)
Definition expr.h:529
Managed reference to LENode.
Definition expr.h:505
TVM_DEFINE_OBJECT_REF_COW_METHOD(LENode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(LE, PrimExpr, LENode)
TVM_TIRX_DLL LE(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
static constexpr bool _type_container_is_exact
Definition expr.h:511
LE(ffi::ObjectPtr< LENode > node)
Definition expr.h:508
a << b
Definition expr.h:129
static constexpr const char * _type_key
Definition expr.h:132
Managed reference to LShiftNode.
Definition expr.h:139
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(LShift, PrimExpr, LShiftNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(LShiftNode)
LShift(ffi::ObjectPtr< LShiftNode > node)
Definition expr.h:142
static constexpr bool _type_container_is_exact
Definition expr.h:145
TVM_TIRX_DLL LShift(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
a < b
Definition expr.h:474
static constexpr const char * _type_key
Definition expr.h:477
Managed reference to LTNode.
Definition expr.h:484
TVM_DEFINE_OBJECT_REF_COW_METHOD(LTNode)
LT(ffi::ObjectPtr< LTNode > node)
Definition expr.h:487
static constexpr bool _type_container_is_exact
Definition expr.h:490
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(LT, PrimExpr, LTNode)
TVM_TIRX_DLL LT(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
Let binding. Bind var to value then evaluate body.
Definition expr.h:727
PrimExpr value
The value to be binded.
Definition expr.h:736
Var var
The variable.
Definition expr.h:734
static void RegisterReflection()
Definition expr.h:739
LetNode(Var var, PrimExpr value, PrimExpr body)
Definition expr.h:729
LetNode(ffi::UnsafeInit tag)
Definition expr.h:731
PrimExpr body
The result expression.
Definition expr.h:738
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.Let", LetNode, ExprNode)
Managed reference to LetNode.
Definition expr.h:753
Let(ffi::ObjectPtr< LetNode > node)
Definition expr.h:756
TVM_DEFINE_OBJECT_REF_COW_METHOD(LetNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Let, PrimExpr, LetNode)
static constexpr bool _type_container_is_exact
Definition expr.h:759
TVM_TIRX_DLL Let(Var var, PrimExpr value, PrimExpr body, Location loc=UnknownLoc())
max(a, b)
Definition expr.h:388
static constexpr const char * _type_key
Definition expr.h:391
Managed reference to MaxNode.
Definition expr.h:398
TVM_TIRX_DLL Max(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
Max(ffi::ObjectPtr< MaxNode > node)
Definition expr.h:401
TVM_DEFINE_OBJECT_REF_COW_METHOD(MaxNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Max, PrimExpr, MaxNode)
static constexpr bool _type_container_is_exact
Definition expr.h:404
min(a, b)
Definition expr.h:367
static constexpr const char * _type_key
Definition expr.h:370
Managed reference to MinNode.
Definition expr.h:377
Min(ffi::ObjectPtr< MinNode > node)
Definition expr.h:380
static constexpr bool _type_container_is_exact
Definition expr.h:383
TVM_DEFINE_OBJECT_REF_COW_METHOD(MinNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Min, PrimExpr, MinNode)
TVM_TIRX_DLL Min(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
a % b in the C semnatics.
Definition expr.h:304
static constexpr const char * _type_key
Definition expr.h:307
Managed reference to ModNode.
Definition expr.h:314
TVM_TIRX_DLL Mod(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
static constexpr bool _type_container_is_exact
Definition expr.h:320
Mod(ffi::ObjectPtr< ModNode > node)
Definition expr.h:317
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Mod, PrimExpr, ModNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(ModNode)
a * b
Definition expr.h:256
static constexpr const char * _type_key
Definition expr.h:259
Managed reference to MulNode.
Definition expr.h:266
Mul(ffi::ObjectPtr< MulNode > node)
Definition expr.h:269
TVM_TIRX_DLL Mul(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_DEFINE_OBJECT_REF_COW_METHOD(MulNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Mul, PrimExpr, MulNode)
static constexpr bool _type_container_is_exact
Definition expr.h:272
a != b
Definition expr.h:453
static constexpr const char * _type_key
Definition expr.h:456
Managed reference to NENode.
Definition expr.h:463
TVM_DEFINE_OBJECT_REF_COW_METHOD(NENode)
NE(ffi::ObjectPtr< NENode > node)
Definition expr.h:466
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(NE, PrimExpr, NENode)
TVM_TIRX_DLL NE(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
static constexpr bool _type_container_is_exact
Definition expr.h:469
static void RegisterReflection()
Definition expr.h:627
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.Not", NotNode, ExprNode)
NotNode(ffi::UnsafeInit tag)
Definition expr.h:623
PrimExpr a
The input operand.
Definition expr.h:626
NotNode(PrimExpr a)
Definition expr.h:622
Managed reference to NotNode.
Definition expr.h:638
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Not, PrimExpr, NotNode)
static constexpr bool _type_container_is_exact
Definition expr.h:644
TVM_TIRX_DLL Not(PrimExpr a, Location loc=UnknownLoc())
TVM_DEFINE_OBJECT_REF_COW_METHOD(NotNode)
Not(ffi::ObjectPtr< NotNode > node)
Definition expr.h:641
a || b
Definition expr.h:589
PrimExpr b
The right operand.
Definition expr.h:597
OrNode(ffi::UnsafeInit tag)
Definition expr.h:592
OrNode(PrimExpr a, PrimExpr b)
Definition expr.h:591
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.Or", OrNode, ExprNode)
static void RegisterReflection()
Definition expr.h:598
PrimExpr a
The left operand.
Definition expr.h:595
Managed reference to OrNode.
Definition expr.h:609
TVM_DEFINE_OBJECT_REF_COW_METHOD(OrNode)
TVM_TIRX_DLL Or(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Or, PrimExpr, OrNode)
static constexpr bool _type_container_is_exact
Definition expr.h:615
Or(ffi::ObjectPtr< OrNode > node)
Definition expr.h:612
a >> b
Definition expr.h:150
static constexpr const char * _type_key
Definition expr.h:153
Managed reference to RShiftNode.
Definition expr.h:160
static constexpr bool _type_container_is_exact
Definition expr.h:166
TVM_DEFINE_OBJECT_REF_COW_METHOD(RShiftNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(RShift, PrimExpr, RShiftNode)
RShift(ffi::ObjectPtr< RShiftNode > node)
Definition expr.h:163
TVM_TIRX_DLL RShift(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
return true_value if condition is true, otherwise return false_value.
Definition expr.h:684
PrimExpr false_value
value to be returned when condition is false.
Definition expr.h:697
PrimExpr true_value
value to be returned when condition is true.
Definition expr.h:695
SelectNode(PrimExpr condition, PrimExpr true_value, PrimExpr false_value)
Definition expr.h:686
PrimExpr condition
The condition.
Definition expr.h:693
SelectNode(ffi::UnsafeInit tag)
Definition expr.h:690
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.Select", SelectNode, ExprNode)
static void RegisterReflection()
Definition expr.h:698
Managed reference to SelectNode.
Definition expr.h:712
static constexpr bool _type_container_is_exact
Definition expr.h:720
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Select, PrimExpr, SelectNode)
TVM_DEFINE_OBJECT_REF_COW_METHOD(SelectNode)
TVM_TIRX_DLL Select(PrimExpr condition, PrimExpr true_value, PrimExpr false_value, Location loc=UnknownLoc())
Select(ffi::ObjectPtr< SelectNode > node)
Definition expr.h:717
a - b
Definition expr.h:234
static constexpr const char * _type_key
Definition expr.h:237
Managed reference to SubNode.
Definition expr.h:244
TVM_TIRX_DLL Sub(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_DEFINE_OBJECT_REF_COW_METHOD(SubNode)
static constexpr bool _type_container_is_exact
Definition expr.h:251
Sub(ffi::ObjectPtr< SubNode > node)
Definition expr.h:248
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Sub, PrimExpr, SubNode)
Copy-on-write helper macro for IR ffi::ObjectRef types.
std::unordered_map< K, V > as_unordered_map(const ffi::Map< K, V > &dmap)
Definition expr.h:772
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
Native object dispatch, visiting and mutation with structural fallback.
#define TVM_TIRX_DLL
Definition base.h:83
Compare two expressions recursively and check if they are equal to each other without var remapping.
Definition expr.h:795
TVM_TIRX_DLL bool operator()(const PrimExpr &lhs, const PrimExpr &rhs) const
a <= b
Definition expr.h:495
static constexpr const char * _type_key
Definition expr.h:498
Primitive vector expressions.