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<CastObj> 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<AddObj> 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<SubObj> node) :
PrimExpr(std::move(node)) {}
269 explicit Mul(ffi::ObjectPtr<MulObj> node) :
PrimExpr(std::move(node)) {}
293 explicit Div(ffi::ObjectPtr<DivObj> node) :
PrimExpr(std::move(node)) {}
317 explicit Mod(ffi::ObjectPtr<ModObj> 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<MinObj> node) :
PrimExpr(std::move(node)) {}
401 explicit Max(ffi::ObjectPtr<MaxObj> 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<EQObj> node) :
PrimExpr(std::move(node)) {}
466 explicit NE(ffi::ObjectPtr<NEObj> node) :
PrimExpr(std::move(node)) {}
487 explicit LT(ffi::ObjectPtr<LTObj> node) :
PrimExpr(std::move(node)) {}
508 explicit LE(ffi::ObjectPtr<LEObj> node) :
PrimExpr(std::move(node)) {}
529 explicit GT(ffi::ObjectPtr<GTObj> node) :
PrimExpr(std::move(node)) {}
550 explicit GE(ffi::ObjectPtr<GEObj> node) :
PrimExpr(std::move(node)) {}
561 explicit AndObj(ffi::UnsafeInit tag) :
a(tag),
b(tag) {}
568 namespace refl = tvm::ffi::reflection;
581 explicit And(ffi::ObjectPtr<AndObj> node) :
PrimExpr(std::move(node)) {}
592 explicit OrObj(ffi::UnsafeInit tag) :
a(tag),
b(tag) {}
599 namespace refl = tvm::ffi::reflection;
612 explicit Or(ffi::ObjectPtr<OrObj> node) :
PrimExpr(std::move(node)) {}
623 explicit NotObj(ffi::UnsafeInit tag) :
a(tag) {}
628 namespace refl = tvm::ffi::reflection;
629 refl::ObjectDef<NotObj>().def_ro(
"a", &
NotObj::a);
641 explicit Not(ffi::ObjectPtr<NotObj> node) :
PrimExpr(std::move(node)) {}
657 namespace refl = tvm::ffi::reflection;
699 namespace refl = tvm::ffi::reflection;
700 refl::ObjectDef<SelectObj>()
740 namespace refl = tvm::ffi::reflection;
741 refl::ObjectDef<LetObj>()
742 .def_ro(
"var", &
LetObj::var, refl::AttachFieldFlag::SEqHashDefSimple())
756 explicit Let(ffi::ObjectPtr<LetObj> 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::CastObj> =
true;
807inline constexpr bool object_ref_contains_v<PrimExpr, prim::AddObj> =
true;
809inline constexpr bool object_ref_contains_v<PrimExpr, prim::BitwiseNotObj> =
true;
811inline constexpr bool object_ref_contains_v<PrimExpr, prim::BitwiseXorObj> =
true;
813inline constexpr bool object_ref_contains_v<PrimExpr, prim::BitwiseOrObj> =
true;
815inline constexpr bool object_ref_contains_v<PrimExpr, prim::BitwiseAndObj> =
true;
817inline constexpr bool object_ref_contains_v<PrimExpr, prim::RShiftObj> =
true;
819inline constexpr bool object_ref_contains_v<PrimExpr, prim::LShiftObj> =
true;
821inline constexpr bool object_ref_contains_v<PrimExpr, prim::SubObj> =
true;
823inline constexpr bool object_ref_contains_v<PrimExpr, prim::MulObj> =
true;
825inline constexpr bool object_ref_contains_v<PrimExpr, prim::DivObj> =
true;
827inline constexpr bool object_ref_contains_v<PrimExpr, prim::ModObj> =
true;
829inline constexpr bool object_ref_contains_v<PrimExpr, prim::FloorDivObj> =
true;
831inline constexpr bool object_ref_contains_v<PrimExpr, prim::FloorModObj> =
true;
833inline constexpr bool object_ref_contains_v<PrimExpr, prim::MinObj> =
true;
835inline constexpr bool object_ref_contains_v<PrimExpr, prim::MaxObj> =
true;
837inline constexpr bool object_ref_contains_v<PrimExpr, prim::EQObj> =
true;
839inline constexpr bool object_ref_contains_v<PrimExpr, prim::NEObj> =
true;
841inline constexpr bool object_ref_contains_v<PrimExpr, prim::LTObj> =
true;
843inline constexpr bool object_ref_contains_v<PrimExpr, prim::LEObj> =
true;
845inline constexpr bool object_ref_contains_v<PrimExpr, prim::GTObj> =
true;
847inline constexpr bool object_ref_contains_v<PrimExpr, prim::GEObj> =
true;
849inline constexpr bool object_ref_contains_v<PrimExpr, prim::AndObj> =
true;
851inline constexpr bool object_ref_contains_v<PrimExpr, prim::OrObj> =
true;
853inline constexpr bool object_ref_contains_v<PrimExpr, prim::NotObj> =
true;
855inline constexpr bool object_ref_contains_v<PrimExpr, prim::SelectObj> =
true;
857inline constexpr bool object_ref_contains_v<PrimExpr, prim::RampObj> =
true;
859inline constexpr bool object_ref_contains_v<PrimExpr, prim::BroadcastObj> =
true;
861inline constexpr bool object_ref_contains_v<PrimExpr, prim::LetObj> =
true;
863inline constexpr bool object_ref_contains_v<PrimExpr, prim::ShuffleObj> =
true;
#define TVM_TIRX_DLL
Definition base.h:55
Helpers for attribute objects.
Base type of all the expressions.
Definition expr.h:66
Constant floating point literals in the program.
Definition expr.h:394
Constant integer literals in the program.
Definition expr.h:314
Non-nullable source-location metadata.
Definition location.h:91
Typed reference/view over any Expr whose ExprObj::ty is PrimType.
Definition expr.h:187
PrimType ty() const
Definition expr.h:164
Reference to the shared immutable unknown location.
Definition location.h:105
Managed reference to VarObj.
Definition expr.h:571
a + b
Definition expr.h:108
static constexpr const char * _type_key
Definition expr.h:111
Managed reference to AddObj.
Definition expr.h:118
TVM_TIRX_DLL Add(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_DEFINE_OBJECT_REF_COW_METHOD(AddObj)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Add, PrimExpr, AddObj)
static constexpr bool _type_container_is_exact
Definition expr.h:124
Add(ffi::ObjectPtr< AddObj > node)
Definition expr.h:121
a && b
Definition expr.h:558
AndObj(PrimExpr a, PrimExpr b)
Definition expr.h:560
PrimExpr b
The right operand.
Definition expr.h:566
static void RegisterReflection()
Definition expr.h:567
AndObj(ffi::UnsafeInit tag)
Definition expr.h:561
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.And", AndObj, ExprObj)
PrimExpr a
The left operand.
Definition expr.h:564
Managed reference to AndObj.
Definition expr.h:578
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(And, PrimExpr, AndObj)
TVM_TIRX_DLL And(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
And(ffi::ObjectPtr< AndObj > node)
Definition expr.h:581
static constexpr bool _type_container_is_exact
Definition expr.h:584
TVM_DEFINE_OBJECT_REF_COW_METHOD(AndObj)
Base template to implement binary ops.
Definition expr.h:89
TVM_FFI_DECLARE_OBJECT_INFO_PREDEFINED_TYPE_KEY(T, ExprObj)
static const constexpr bool _type_final
Definition expr.h:103
static const constexpr int _type_child_slots
Definition expr.h:102
static void RegisterReflection()
Definition expr.h:98
BinaryOpObj(ffi::UnsafeInit tag)
Definition expr.h:92
BinaryOpObj(PrimExpr a, PrimExpr b)
Definition expr.h:91
PrimExpr a
The left operand.
Definition expr.h:95
PrimExpr b
The right operand.
Definition expr.h:97
a & b
Definition expr.h:171
static constexpr const char * _type_key
Definition expr.h:174
Managed reference to BitwiseAndObj.
Definition expr.h:181
TVM_TIRX_DLL BitwiseAnd(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(BitwiseAnd, PrimExpr, BitwiseAndObj)
static constexpr bool _type_container_is_exact
Definition expr.h:187
TVM_DEFINE_OBJECT_REF_COW_METHOD(BitwiseAndObj)
BitwiseAnd(ffi::ObjectPtr< BitwiseAndObj > node)
Definition expr.h:184
BitwiseNotObj(ffi::UnsafeInit tag)
Definition expr.h:652
static void RegisterReflection()
Definition expr.h:656
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.BitwiseNot", BitwiseNotObj, ExprObj)
PrimExpr a
The input operand.
Definition expr.h:655
BitwiseNotObj(PrimExpr a)
Definition expr.h:651
Managed reference to BitwiseNotObj.
Definition expr.h:667
TVM_TIRX_DLL BitwiseNot(PrimExpr a, Location loc=UnknownLoc())
BitwiseNot(ffi::ObjectPtr< BitwiseNotObj > node)
Definition expr.h:670
static constexpr bool _type_container_is_exact
Definition expr.h:673
TVM_DEFINE_OBJECT_REF_COW_METHOD(BitwiseNotObj)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(BitwiseNot, PrimExpr, BitwiseNotObj)
a | b
Definition expr.h:192
static constexpr const char * _type_key
Definition expr.h:195
Managed reference to BitwiseOrObj.
Definition expr.h:202
BitwiseOr(ffi::ObjectPtr< BitwiseOrObj > 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, BitwiseOrObj)
TVM_DEFINE_OBJECT_REF_COW_METHOD(BitwiseOrObj)
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 BitwiseXorObj.
Definition expr.h:223
static constexpr bool _type_container_is_exact
Definition expr.h:229
BitwiseXor(ffi::ObjectPtr< BitwiseXorObj > node)
Definition expr.h:226
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(BitwiseXor, PrimExpr, BitwiseXorObj)
TVM_TIRX_DLL BitwiseXor(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_DEFINE_OBJECT_REF_COW_METHOD(BitwiseXorObj)
Cast value from one data type to another.
Definition expr.h:56
static void RegisterReflection()
Definition expr.h:63
CastObj(PrimExpr value)
Definition expr.h:58
PrimExpr value
Original data type.
Definition expr.h:62
CastObj(ffi::UnsafeInit tag)
Definition expr.h:59
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.Cast", CastObj, ExprObj)
Managed reference to CastObj.
Definition expr.h:74
Cast(ffi::ObjectPtr< CastObj > node)
Definition expr.h:77
static constexpr bool _type_container_is_exact
Definition expr.h:80
TVM_DEFINE_OBJECT_REF_COW_METHOD(CastObj)
TVM_TIRX_DLL Cast(PrimType ty, PrimExpr value, Location loc=UnknownLoc())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Cast, PrimExpr, CastObj)
Base template to implement comparison ops.
Definition expr.h:413
PrimExpr a
The left operand.
Definition expr.h:419
static void RegisterReflection()
Definition expr.h:422
TVM_FFI_DECLARE_OBJECT_INFO_PREDEFINED_TYPE_KEY(T, ExprObj)
CmpOpObj(PrimExpr a, PrimExpr b)
Definition expr.h:415
static const constexpr bool _type_final
Definition expr.h:427
static const constexpr int _type_child_slots
Definition expr.h:426
CmpOpObj(ffi::UnsafeInit tag)
Definition expr.h:416
PrimExpr b
The right operand.
Definition expr.h:421
a / b in the C semnatics.
Definition expr.h:280
static constexpr const char * _type_key
Definition expr.h:283
Managed reference to DivObj.
Definition expr.h:290
Div(ffi::ObjectPtr< DivObj > node)
Definition expr.h:293
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Div, PrimExpr, DivObj)
TVM_TIRX_DLL Div(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_DEFINE_OBJECT_REF_COW_METHOD(DivObj)
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 EQObj.
Definition expr.h:442
TVM_TIRX_DLL EQ(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
EQ(ffi::ObjectPtr< EQObj > node)
Definition expr.h:445
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(EQ, PrimExpr, EQObj)
static constexpr bool _type_container_is_exact
Definition expr.h:448
TVM_DEFINE_OBJECT_REF_COW_METHOD(EQObj)
Floor division, floor(a/b)
Definition expr.h:325
static constexpr const char * _type_key
Definition expr.h:328
Managed reference to FloorDivObj.
Definition expr.h:335
static constexpr bool _type_container_is_exact
Definition expr.h:341
TVM_DEFINE_OBJECT_REF_COW_METHOD(FloorDivObj)
FloorDiv(ffi::ObjectPtr< FloorDivObj > node)
Definition expr.h:338
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(FloorDiv, PrimExpr, FloorDivObj)
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 FloorModObj.
Definition expr.h:356
FloorMod(ffi::ObjectPtr< FloorModObj > node)
Definition expr.h:359
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(FloorMod, PrimExpr, FloorModObj)
TVM_TIRX_DLL FloorMod(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
static constexpr bool _type_container_is_exact
Definition expr.h:362
TVM_DEFINE_OBJECT_REF_COW_METHOD(FloorModObj)
a >= b
Definition expr.h:537
static constexpr const char * _type_key
Definition expr.h:540
Managed reference to GEObj.
Definition expr.h:547
GE(ffi::ObjectPtr< GEObj > node)
Definition expr.h:550
static constexpr bool _type_container_is_exact
Definition expr.h:553
TVM_DEFINE_OBJECT_REF_COW_METHOD(GEObj)
TVM_TIRX_DLL GE(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(GE, PrimExpr, GEObj)
a > b
Definition expr.h:516
static constexpr const char * _type_key
Definition expr.h:519
Managed reference to GTObj.
Definition expr.h:526
GT(ffi::ObjectPtr< GTObj > node)
Definition expr.h:529
static constexpr bool _type_container_is_exact
Definition expr.h:532
TVM_TIRX_DLL GT(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_DEFINE_OBJECT_REF_COW_METHOD(GTObj)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(GT, PrimExpr, GTObj)
Managed reference to LEObj.
Definition expr.h:505
LE(ffi::ObjectPtr< LEObj > node)
Definition expr.h:508
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(LE, PrimExpr, LEObj)
TVM_TIRX_DLL LE(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
static constexpr bool _type_container_is_exact
Definition expr.h:511
TVM_DEFINE_OBJECT_REF_COW_METHOD(LEObj)
a << b
Definition expr.h:129
static constexpr const char * _type_key
Definition expr.h:132
Managed reference to LShiftObj.
Definition expr.h:139
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(LShift, PrimExpr, LShiftObj)
LShift(ffi::ObjectPtr< LShiftObj > node)
Definition expr.h:142
TVM_DEFINE_OBJECT_REF_COW_METHOD(LShiftObj)
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 LTObj.
Definition expr.h:484
TVM_DEFINE_OBJECT_REF_COW_METHOD(LTObj)
static constexpr bool _type_container_is_exact
Definition expr.h:490
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(LT, PrimExpr, LTObj)
LT(ffi::ObjectPtr< LTObj > node)
Definition expr.h:487
TVM_TIRX_DLL LT(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
Let binding. Bind var to value then evaluate body.
Definition expr.h:727
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.Let", LetObj, ExprObj)
PrimExpr body
The result expression.
Definition expr.h:738
LetObj(ffi::UnsafeInit tag)
Definition expr.h:731
LetObj(Var var, PrimExpr value, PrimExpr body)
Definition expr.h:729
Var var
The variable.
Definition expr.h:734
static void RegisterReflection()
Definition expr.h:739
PrimExpr value
The value to be binded.
Definition expr.h:736
Managed reference to LetObj.
Definition expr.h:753
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Let, PrimExpr, LetObj)
TVM_DEFINE_OBJECT_REF_COW_METHOD(LetObj)
Let(ffi::ObjectPtr< LetObj > node)
Definition expr.h:756
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 MaxObj.
Definition expr.h:398
TVM_TIRX_DLL Max(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
Max(ffi::ObjectPtr< MaxObj > node)
Definition expr.h:401
TVM_DEFINE_OBJECT_REF_COW_METHOD(MaxObj)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Max, PrimExpr, MaxObj)
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 MinObj.
Definition expr.h:377
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Min, PrimExpr, MinObj)
static constexpr bool _type_container_is_exact
Definition expr.h:383
Min(ffi::ObjectPtr< MinObj > node)
Definition expr.h:380
TVM_DEFINE_OBJECT_REF_COW_METHOD(MinObj)
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 ModObj.
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
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Mod, PrimExpr, ModObj)
Mod(ffi::ObjectPtr< ModObj > node)
Definition expr.h:317
TVM_DEFINE_OBJECT_REF_COW_METHOD(ModObj)
a * b
Definition expr.h:256
static constexpr const char * _type_key
Definition expr.h:259
Managed reference to MulObj.
Definition expr.h:266
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Mul, PrimExpr, MulObj)
TVM_TIRX_DLL Mul(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
static constexpr bool _type_container_is_exact
Definition expr.h:272
Mul(ffi::ObjectPtr< MulObj > node)
Definition expr.h:269
TVM_DEFINE_OBJECT_REF_COW_METHOD(MulObj)
a != b
Definition expr.h:453
static constexpr const char * _type_key
Definition expr.h:456
Managed reference to NEObj.
Definition expr.h:463
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(NE, PrimExpr, NEObj)
NE(ffi::ObjectPtr< NEObj > node)
Definition expr.h:466
TVM_TIRX_DLL NE(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
static constexpr bool _type_container_is_exact
Definition expr.h:469
TVM_DEFINE_OBJECT_REF_COW_METHOD(NEObj)
static void RegisterReflection()
Definition expr.h:627
NotObj(ffi::UnsafeInit tag)
Definition expr.h:623
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.Not", NotObj, ExprObj)
NotObj(PrimExpr a)
Definition expr.h:622
PrimExpr a
The input operand.
Definition expr.h:626
Managed reference to NotObj.
Definition expr.h:638
TVM_DEFINE_OBJECT_REF_COW_METHOD(NotObj)
Not(ffi::ObjectPtr< NotObj > node)
Definition expr.h:641
static constexpr bool _type_container_is_exact
Definition expr.h:644
TVM_TIRX_DLL Not(PrimExpr a, Location loc=UnknownLoc())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Not, PrimExpr, NotObj)
a || b
Definition expr.h:589
OrObj(ffi::UnsafeInit tag)
Definition expr.h:592
static void RegisterReflection()
Definition expr.h:598
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.Or", OrObj, ExprObj)
PrimExpr b
The right operand.
Definition expr.h:597
OrObj(PrimExpr a, PrimExpr b)
Definition expr.h:591
PrimExpr a
The left operand.
Definition expr.h:595
Managed reference to OrObj.
Definition expr.h:609
Or(ffi::ObjectPtr< OrObj > node)
Definition expr.h:612
TVM_DEFINE_OBJECT_REF_COW_METHOD(OrObj)
TVM_TIRX_DLL Or(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Or, PrimExpr, OrObj)
static constexpr bool _type_container_is_exact
Definition expr.h:615
a >> b
Definition expr.h:150
static constexpr const char * _type_key
Definition expr.h:153
Managed reference to RShiftObj.
Definition expr.h:160
static constexpr bool _type_container_is_exact
Definition expr.h:166
TVM_DEFINE_OBJECT_REF_COW_METHOD(RShiftObj)
RShift(ffi::ObjectPtr< RShiftObj > node)
Definition expr.h:163
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(RShift, PrimExpr, RShiftObj)
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
SelectObj(ffi::UnsafeInit tag)
Definition expr.h:690
PrimExpr false_value
value to be returned when condition is false.
Definition expr.h:697
SelectObj(PrimExpr condition, PrimExpr true_value, PrimExpr false_value)
Definition expr.h:686
PrimExpr condition
The condition.
Definition expr.h:693
PrimExpr true_value
value to be returned when condition is true.
Definition expr.h:695
static void RegisterReflection()
Definition expr.h:698
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("prim.Select", SelectObj, ExprObj)
Managed reference to SelectObj.
Definition expr.h:712
TVM_DEFINE_OBJECT_REF_COW_METHOD(SelectObj)
Select(ffi::ObjectPtr< SelectObj > node)
Definition expr.h:717
static constexpr bool _type_container_is_exact
Definition expr.h:720
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Select, PrimExpr, SelectObj)
TVM_TIRX_DLL Select(PrimExpr condition, PrimExpr true_value, PrimExpr false_value, Location loc=UnknownLoc())
a - b
Definition expr.h:234
static constexpr const char * _type_key
Definition expr.h:237
Managed reference to SubObj.
Definition expr.h:244
TVM_TIRX_DLL Sub(PrimExpr a, PrimExpr b, Location loc=UnknownLoc())
Sub(ffi::ObjectPtr< SubObj > node)
Definition expr.h:248
static constexpr bool _type_container_is_exact
Definition expr.h:251
TVM_DEFINE_OBJECT_REF_COW_METHOD(SubObj)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(Sub, PrimExpr, SubObj)
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 analysis.h:41
Native object dispatch, visiting and mutation with structural fallback.
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.