Skip to content

Commit

Permalink
[TIR][REFACTOR] Add tir prefix to type keys
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Jun 14, 2020
1 parent a14a98e commit 5d80b56
Show file tree
Hide file tree
Showing 18 changed files with 186 additions and 149 deletions.
4 changes: 2 additions & 2 deletions include/tvm/tir/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class BufferNode : public Object {
return shape.size() != 0 ? shape[0].dtype() : DataType::Int(32);
}

static constexpr const char* _type_key = "Buffer";
static constexpr const char* _type_key = "tir.Buffer";
static constexpr const bool _type_has_method_sequal_reduce = true;
static constexpr const bool _type_has_method_shash_reduce = true;
TVM_DECLARE_FINAL_OBJECT_INFO(BufferNode, Object);
Expand Down Expand Up @@ -228,7 +228,7 @@ class DataProducerNode : public Object {

void SHashReduce(SHashReducer hash_reduce) const {}

static constexpr const char* _type_key = "DataProducer";
static constexpr const char* _type_key = "tir.DataProducer";
static constexpr const bool _type_has_method_sequal_reduce = true;
static constexpr const bool _type_has_method_shash_reduce = true;
TVM_DECLARE_BASE_OBJECT_INFO(DataProducerNode, Object);
Expand Down
4 changes: 2 additions & 2 deletions include/tvm/tir/data_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class LayoutNode : public Object {
v->Visit("axes", &axes);
}

static constexpr const char* _type_key = "Layout";
static constexpr const char* _type_key = "tir.Layout";
TVM_DECLARE_FINAL_OBJECT_INFO(LayoutNode, Object);
};

Expand Down Expand Up @@ -308,7 +308,7 @@ class BijectiveLayoutNode : public Object {
v->Visit("backward_rule", &backward_rule);
}

static constexpr const char* _type_key = "BijectiveLayout";
static constexpr const char* _type_key = "tir.BijectiveLayout";
TVM_DECLARE_FINAL_OBJECT_INFO(BijectiveLayoutNode, Object);
};

Expand Down
64 changes: 32 additions & 32 deletions include/tvm/tir/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class StringImmNode : public PrimExprNode {

void SHashReduce(SHashReducer hash_reduce) const { hash_reduce(value); }

static constexpr const char* _type_key = "StringImm";
static constexpr const char* _type_key = "tir.StringImm";
TVM_DECLARE_FINAL_OBJECT_INFO(StringImmNode, PrimExprNode);
};

Expand Down Expand Up @@ -101,7 +101,7 @@ class CastNode : public PrimExprNode {
hash_reduce(value);
}

static constexpr const char* _type_key = "Cast";
static constexpr const char* _type_key = "tir.Cast";
TVM_DECLARE_FINAL_OBJECT_INFO(CastNode, PrimExprNode);
};

Expand Down Expand Up @@ -149,7 +149,7 @@ class BinaryOpNode : public PrimExprNode {
/*! \brief a + b */
class AddNode : public BinaryOpNode<AddNode> {
public:
static constexpr const char* _type_key = "Add";
static constexpr const char* _type_key = "tir.Add";
};

/*!
Expand All @@ -165,7 +165,7 @@ class Add : public PrimExpr {
/*! \brief a - b */
class SubNode : public BinaryOpNode<SubNode> {
public:
static constexpr const char* _type_key = "Sub";
static constexpr const char* _type_key = "tir.Sub";
};

/*!
Expand All @@ -181,7 +181,7 @@ class Sub : public PrimExpr {
/*! \brief a * b */
class MulNode : public BinaryOpNode<MulNode> {
public:
static constexpr const char* _type_key = "Mul";
static constexpr const char* _type_key = "tir.Mul";
};

/*!
Expand All @@ -200,7 +200,7 @@ class Mul : public PrimExpr {
*/
class DivNode : public BinaryOpNode<DivNode> {
public:
static constexpr const char* _type_key = "Div";
static constexpr const char* _type_key = "tir.Div";
};

/*!
Expand All @@ -219,7 +219,7 @@ class Div : public PrimExpr {
*/
class ModNode : public BinaryOpNode<ModNode> {
public:
static constexpr const char* _type_key = "Mod";
static constexpr const char* _type_key = "tir.Mod";
};

/*!
Expand All @@ -235,7 +235,7 @@ class Mod : public PrimExpr {
/*! \brief Floor division, floor(a/b) */
class FloorDivNode : public BinaryOpNode<FloorDivNode> {
public:
static constexpr const char* _type_key = "FloorDiv";
static constexpr const char* _type_key = "tir.FloorDiv";
};

/*!
Expand All @@ -251,7 +251,7 @@ class FloorDiv : public PrimExpr {
/*! \brief The remainder of the floordiv */
class FloorModNode : public BinaryOpNode<FloorModNode> {
public:
static constexpr const char* _type_key = "FloorMod";
static constexpr const char* _type_key = "tir.FloorMod";
};

/*!
Expand All @@ -267,7 +267,7 @@ class FloorMod : public PrimExpr {
/*! \brief min(a, b) */
class MinNode : public BinaryOpNode<MinNode> {
public:
static constexpr const char* _type_key = "Min";
static constexpr const char* _type_key = "tir.Min";
};

/*!
Expand All @@ -283,7 +283,7 @@ class Min : public PrimExpr {
/*! \brief max(a, b) */
class MaxNode : public BinaryOpNode<MaxNode> {
public:
static constexpr const char* _type_key = "Max";
static constexpr const char* _type_key = "tir.Max";
};

/*!
Expand Down Expand Up @@ -330,7 +330,7 @@ class CmpOpNode : public PrimExprNode {
/*! \brief a == b */
class EQNode : public CmpOpNode<EQNode> {
public:
static constexpr const char* _type_key = "EQ";
static constexpr const char* _type_key = "tir.EQ";
};

/*!
Expand All @@ -346,7 +346,7 @@ class EQ : public PrimExpr {
/*! \brief a != b */
class NENode : public CmpOpNode<NENode> {
public:
static constexpr const char* _type_key = "NE";
static constexpr const char* _type_key = "tir.NE";
};

/*!
Expand All @@ -362,7 +362,7 @@ class NE : public PrimExpr {
/*! \brief a < b */
class LTNode : public CmpOpNode<LTNode> {
public:
static constexpr const char* _type_key = "LT";
static constexpr const char* _type_key = "tir.LT";
};

/*!
Expand All @@ -378,7 +378,7 @@ class LT : public PrimExpr {
/*! \brief a <= b */
struct LENode : public CmpOpNode<LENode> {
public:
static constexpr const char* _type_key = "LE";
static constexpr const char* _type_key = "tir.LE";
};

/*!
Expand All @@ -394,7 +394,7 @@ class LE : public PrimExpr {
/*! \brief a > b */
class GTNode : public CmpOpNode<GTNode> {
public:
static constexpr const char* _type_key = "GT";
static constexpr const char* _type_key = "tir.GT";
};

/*!
Expand All @@ -410,7 +410,7 @@ class GT : public PrimExpr {
/*! \brief a >= b */
class GENode : public CmpOpNode<GENode> {
public:
static constexpr const char* _type_key = "GE";
static constexpr const char* _type_key = "tir.GE";
};

/*!
Expand Down Expand Up @@ -447,7 +447,7 @@ class AndNode : public PrimExprNode {
hash_reduce(b);
}

static constexpr const char* _type_key = "And";
static constexpr const char* _type_key = "tir.And";
TVM_DECLARE_FINAL_OBJECT_INFO(AndNode, PrimExprNode);
};

Expand Down Expand Up @@ -485,7 +485,7 @@ class OrNode : public PrimExprNode {
hash_reduce(b);
}

static constexpr const char* _type_key = "Or";
static constexpr const char* _type_key = "tir.Or";
TVM_DECLARE_FINAL_OBJECT_INFO(OrNode, PrimExprNode);
};

Expand Down Expand Up @@ -519,7 +519,7 @@ class NotNode : public PrimExprNode {
hash_reduce(a);
}

static constexpr const char* _type_key = "Not";
static constexpr const char* _type_key = "tir.Not";
TVM_DECLARE_FINAL_OBJECT_INFO(NotNode, PrimExprNode);
};

Expand Down Expand Up @@ -568,7 +568,7 @@ class SelectNode : public PrimExprNode {
hash_reduce(false_value);
}

static constexpr const char* _type_key = "Select";
static constexpr const char* _type_key = "tir.Select";
TVM_DECLARE_FINAL_OBJECT_INFO(SelectNode, PrimExprNode);
};

Expand Down Expand Up @@ -617,7 +617,7 @@ class BufferLoadNode : public PrimExprNode {
hash_reduce(indices);
}

static constexpr const char* _type_key = "BufferLoad";
static constexpr const char* _type_key = "tir.BufferLoad";
TVM_DECLARE_FINAL_OBJECT_INFO(BufferLoadNode, PrimExprNode);
};

Expand Down Expand Up @@ -664,7 +664,7 @@ class ProducerLoadNode : public PrimExprNode {
hash_reduce(indices);
}

static constexpr const char* _type_key = "ProducerLoad";
static constexpr const char* _type_key = "tir.ProducerLoad";
TVM_DECLARE_FINAL_OBJECT_INFO(ProducerLoadNode, PrimExprNode);
};

Expand Down Expand Up @@ -722,7 +722,7 @@ class LoadNode : public PrimExprNode {
hash_reduce(predicate);
}

static constexpr const char* _type_key = "Load";
static constexpr const char* _type_key = "tir.Load";
TVM_DECLARE_FINAL_OBJECT_INFO(LoadNode, PrimExprNode);
};

Expand Down Expand Up @@ -773,7 +773,7 @@ class RampNode : public PrimExprNode {
hash_reduce(lanes);
}

static constexpr const char* _type_key = "Ramp";
static constexpr const char* _type_key = "tir.Ramp";
TVM_DECLARE_FINAL_OBJECT_INFO(RampNode, PrimExprNode);
};

Expand Down Expand Up @@ -811,7 +811,7 @@ class BroadcastNode : public PrimExprNode {
hash_reduce(lanes);
}

static constexpr const char* _type_key = "Broadcast";
static constexpr const char* _type_key = "tir.Broadcast";
TVM_DECLARE_FINAL_OBJECT_INFO(BroadcastNode, PrimExprNode);
};

Expand Down Expand Up @@ -856,7 +856,7 @@ class LetNode : public PrimExprNode {
hash_reduce(body);
}

static constexpr const char* _type_key = "Let";
static constexpr const char* _type_key = "tir.Let";
TVM_DECLARE_FINAL_OBJECT_INFO(LetNode, PrimExprNode);
};

Expand Down Expand Up @@ -928,7 +928,7 @@ class CallNode : public PrimExprNode {
/*! \return Whether call node can be vectorized. */
bool is_vectorizable() const;

static constexpr const char* _type_key = "Call";
static constexpr const char* _type_key = "tir.Call";
TVM_DECLARE_FINAL_OBJECT_INFO(CallNode, PrimExprNode);

// Build-in intrinsics
Expand Down Expand Up @@ -990,7 +990,7 @@ class ShuffleNode : public PrimExprNode {
hash_reduce(indices);
}

static constexpr const char* _type_key = "Shuffle";
static constexpr const char* _type_key = "tir.Shuffle";
TVM_DECLARE_FINAL_OBJECT_INFO(ShuffleNode, PrimExprNode);
};

Expand Down Expand Up @@ -1048,7 +1048,7 @@ class CommReducerNode : public Object {
hash_reduce(identity_element);
}

static constexpr const char* _type_key = "CommReducer";
static constexpr const char* _type_key = "tir.CommReducer";
static constexpr const bool _type_has_method_sequal_reduce = true;
static constexpr const bool _type_has_method_shash_reduce = true;
TVM_DECLARE_FINAL_OBJECT_INFO(CommReducerNode, Object);
Expand Down Expand Up @@ -1108,7 +1108,7 @@ class ReduceNode : public PrimExprNode {
hash_reduce(value_index);
}

static constexpr const char* _type_key = "Reduce";
static constexpr const char* _type_key = "tir.Reduce";
TVM_DECLARE_FINAL_OBJECT_INFO(ReduceNode, PrimExprNode);
};

Expand Down Expand Up @@ -1136,7 +1136,7 @@ class AnyNode : public PrimExprNode {
/*! \brief Convert to var. */
Var ToVar() const { return Var("any_dim", DataType::Int(32)); }

static constexpr const char* _type_key = "Any";
static constexpr const char* _type_key = "tir.Any";
TVM_DECLARE_FINAL_OBJECT_INFO(AnyNode, PrimExprNode);
};

Expand Down
Loading

0 comments on commit 5d80b56

Please sign in to comment.