Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/dso_plugin_module/plugin_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class MyModuleNode : public ModuleNode {
return TypedPackedFunc<int(int)>([sptr_to_self, this](int value) { return value_ * value; });
} else {
LOG(FATAL) << "unknown function " << name;
return PackedFunc();
}
}

Expand Down
1 change: 0 additions & 1 deletion include/tvm/runtime/data_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ inline const char* DLDataTypeCode2Str(DLDataTypeCode type_code) {
return "bfloat";
default:
LOG(FATAL) << "unknown type_code=" << static_cast<int>(type_code);
return "";
}
}

Expand Down
1 change: 0 additions & 1 deletion include/tvm/runtime/device_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ inline const char* DeviceName(int type) {
return "microdev";
default:
LOG(FATAL) << "unknown type =" << type;
return "Unknown";
}
}

Expand Down
6 changes: 4 additions & 2 deletions include/tvm/runtime/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ class LogFatal {
#pragma disagnostic push
#pragma warning(disable : 4722)
#endif
~LogFatal() TVM_THROW_EXCEPTION { GetEntry().Finalize(); }
[[noreturn]] ~LogFatal() TVM_THROW_EXCEPTION { GetEntry().Finalize(); }
#ifdef _MSC_VER
#pragma disagnostic pop
#endif
Expand All @@ -366,7 +366,9 @@ class LogFatal {
this->file_ = file;
this->lineno_ = lineno;
}
TVM_NO_INLINE dmlc::Error Finalize() { throw InternalError(file_, lineno_, stream_.str()); }
[[noreturn]] TVM_NO_INLINE dmlc::Error Finalize() {
throw InternalError(file_, lineno_, stream_.str());
}
std::ostringstream stream_;
std::string file_;
int lineno_;
Expand Down
1 change: 0 additions & 1 deletion include/tvm/runtime/packed_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,6 @@ inline const char* ArgTypeCode2Str(int type_code) {
return "ObjectRValueRefArg";
default:
LOG(FATAL) << "unknown type_code=" << static_cast<int>(type_code);
return "";
}
}

Expand Down
1 change: 0 additions & 1 deletion include/tvm/tir/expr_functor.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ class ExprFunctor<R(const PrimExpr& n, Args...)> {
virtual R VisitExpr_(const AnyNode* op, Args... args) EXPR_FUNCTOR_DEFAULT;
virtual R VisitExprDefault_(const Object* op, Args...) {
LOG(FATAL) << "Do not have a default for " << op->GetTypeKey();
return R();
}

private:
Expand Down
1 change: 0 additions & 1 deletion include/tvm/tir/op.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,6 @@ inline PrimExpr MakeConstScalar(DataType t, ValueType value, Span span = Span())
return FloatImm(t, static_cast<double>(value), span);
}
LOG(FATAL) << "cannot make const for type " << t;
return PrimExpr();
}

template <>
Expand Down
1 change: 0 additions & 1 deletion include/tvm/tir/op_attr_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ inline std::ostream& operator<<(std::ostream& os, CallEffectKind side_effect) {

default:
LOG(FATAL) << "Unknown CallEffectKind: " << static_cast<int>(side_effect);
return os;
}
}

Expand Down
1 change: 0 additions & 1 deletion include/tvm/tir/stmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,6 @@ inline const char* ForKind2String(ForKind t) {
return "thread_binding";
}
LOG(FATAL) << "Unknown ForKind" << t;
return "Unknown";
}

} // namespace tir
Expand Down
1 change: 0 additions & 1 deletion include/tvm/tir/stmt_functor.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ class StmtFunctor<R(const Stmt& n, Args... args)> {
virtual R VisitStmt_(const BlockRealizeNode* op, Args... args) STMT_FUNCTOR_DEFAULT;
virtual R VisitStmtDefault_(const Object* op, Args...) {
LOG(FATAL) << "Do not have a default for " << op->GetTypeKey();
return R();
}

private:
Expand Down
1 change: 0 additions & 1 deletion src/arith/bound_deducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ CompareOp BoundDeducer::ReverseOp(CompareOp comp_op) {
return kGreater;
default:
LOG(FATAL) << "Not a valid compare op";
return kGreater; // return some default value
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/arith/iter_affine_map.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,6 @@ IterSumExpr IterMapRewriter::PreprocessDividend(IterMapExpr dividend, PrimExpr o
return fused;
} else {
LOG(FATAL) << "Unsupported subclass of IterMarkExpr";
return IterSumExpr();
}
}

Expand Down Expand Up @@ -1855,7 +1854,6 @@ class SubspaceDivider {
return IterSplitExpr(IterMark(GetRef<IterSumExpr>(op), extent));
} else {
LOG(FATAL) << "Unknown IterMapExpr type";
return NullValue<IterSplitExpr>();
}
}
};
Expand Down
1 change: 0 additions & 1 deletion src/arith/narrow_predicate_expression.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ class ExpressionNarrower : public tir::ExprMutator {

default:
LOG(FATAL) << "Unhandled Context, all legal values should be handled";
return Context::Maximize;
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/arith/transitive_comparison_analyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ CompareResult Reverse(CompareResult res) {
return CompareResult::kUnknown;
default:
LOG(FATAL) << "Invalid CompareResult: " << static_cast<int>(res);
return CompareResult::kInconsistent;
}
}

Expand Down Expand Up @@ -864,11 +863,9 @@ CompareResult TransitiveComparisonAnalyzer::Impl::MergeComparisons(
case CompareResult::kGT:
case CompareResult::kLT:
LOG(FATAL) << "Internal error, normalized comparisons should only include <= and >=";
return CompareResult::kInconsistent;

default:
LOG(FATAL) << "Invalid CompareResult: " << static_cast<int>(cmp.result_);
return CompareResult::kInconsistent;
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/auto_scheduler/search_policy/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ inline int OperationToStage(const te::Operation& op, const State& state) {
}
}
LOG(FATAL) << "Cannot find op: " << op;
return -1;
}

/********** Get Parameters **********/
Expand Down Expand Up @@ -531,7 +530,6 @@ inline Iterator GetLastReduceIteratorInOutermostReduceTile(const Stage& stage) {
}

LOG(FATAL) << "Cannot find the iterator.";
return stage->iters[0];
}

/*! \brief Get the target stage id of a history step in the new state.
Expand Down
1 change: 0 additions & 1 deletion src/auto_scheduler/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ inline int GetIndex(const Array<T>& array, const T& to_locate) {
}
}
LOG(FATAL) << "Cannot find the item";
return -1;
}

/*! \brief Delete the item in a std::vector if it exists. */
Expand Down
1 change: 0 additions & 1 deletion src/ir/function.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ TVM_REGISTER_GLOBAL("ir.BaseFuncWithAttr")
return WithAttr(Downcast<relay::Function>(std::move(func)), key, value);
} else {
LOG(FATAL) << "Do not support function type " << func->GetTypeKey();
return func;
}
});

Expand Down
1 change: 0 additions & 1 deletion src/ir/module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ Constructor IRModuleNode::GetConstructor(const String& adt, const String& cons)
}

LOG(FATAL) << adt << " does not contain constructor " << cons;
return {};
}

tvm::Array<GlobalTypeVar> IRModuleNode::GetGlobalTypeVars() const {
Expand Down
1 change: 0 additions & 1 deletion src/meta_schedule/module_equality.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ std::unique_ptr<ModuleEquality> ModuleEquality::Create(const std::string& mod_eq
return std::make_unique<ModuleEqualityAnchorBlock>();
}
LOG(FATAL) << "Unknown module equality " << mod_eq_name;
return nullptr;
}

} // namespace meta_schedule
Expand Down
1 change: 0 additions & 1 deletion src/parser/meta_ref.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ TVM_REGISTER_NODE_TYPE(MetaRefAttrs);
bool MetaRefRel(const Array<Type>& types, int num_inputs, const Attrs& attrs,
const TypeReporter& reporter) {
LOG(FATAL) << "need to expand before type checking";
return true;
}

RELAY_REGISTER_OP("parser.MetaRef")
Expand Down
1 change: 0 additions & 1 deletion src/parser/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@ class Parser {
return support::FloatImmToNDArray(Downcast<tvm::FloatImm>(token->data));
} else {
LOG(FATAL) << "internal error: should only call this function on numeric tokens";
return {};
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/parser/token.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ std::string ToString(const TokenType& token_type) {
// Older compilers warn even though the above code is exhaustive.
default:
LOG(FATAL) << "unreachable code";
return "";
}
}

Expand Down Expand Up @@ -339,7 +338,6 @@ std::string Pretty(const TokenType& token_type) {
// Older compilers warn even though the above code is exhaustive.
default:
LOG(FATAL) << "unreachable code";
return "";
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/printer/tvmscript_printer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -756,18 +756,15 @@ Doc TVMScriptPrinter::Print(const ObjectRef& node) {
return PrintTarget(node.as<TargetNode>());
} else {
LOG(FATAL) << "Do not know how to print " << node->GetTypeKey();
return Doc();
}
}

Doc TVMScriptPrinter::VisitExprDefault_(const Object* op, ExprPrecedence* out_precedence) {
LOG(FATAL) << "Do not know how to print " << op->GetTypeKey();
return Doc();
}

Doc TVMScriptPrinter::VisitStmtDefault_(const Object* op) {
LOG(FATAL) << "Do not know how to print " << op->GetTypeKey();
return Doc();
}

Doc TVMScriptPrinter::VisitExpr_(const IntImmNode* op, ExprPrecedence* out_precedence) {
Expand Down
1 change: 0 additions & 1 deletion src/relay/backend/aot/aot_lower_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ class AOTMainLowerer : public MixedModeVisitor {
// TODO(mbs): device_copy cleaunp
// Suspect treating as no-op is better since already built into the StorageInfo?
LOG(FATAL) << "The AOT executor does not currently support device_copy";
return;
}

// At this point we should only see calls of the form call_lowered(@callee, (args...)),
Expand Down
1 change: 0 additions & 1 deletion src/relay/backend/aot_executor_codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,6 @@ class AOTExecutorCodegen : public MixedModeVisitor {
// TODO(mbs): device_copy cleaunp
// Suspect treating as no-op is better since already built into the StorageInfo?
LOG(FATAL) << "The AOT executor does not currently support device_copy";
return;
}

// At this point we should only see calls of the form call_lowered(@callee, (args...)),
Expand Down
1 change: 0 additions & 1 deletion src/relay/backend/contrib/codegen_c/codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class CodegenC : public backend::MemoizedExprTranslator<std::vector<Output>>, pu
private:
std::vector<Output> VisitExprDefault_(const Object* op) override {
LOG(FATAL) << "C codegen doesn't support: " << op->GetTypeKey();
return {};
}

std::vector<Output> VisitExpr_(const VarNode* node) override {
Expand Down
1 change: 0 additions & 1 deletion src/relay/backend/contrib/codegen_json/codegen_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ class JSONSerializer : public MemoizedExprTranslator<std::vector<JSONGraphNodeEn

std::vector<JSONGraphNodeEntry> VisitExprDefault_(const Object* op) {
LOG(FATAL) << "JSON runtime currently doesn't support " << op->GetTypeKey();
return {};
}

std::vector<JSONGraphNodeEntry> VisitExpr_(const VarNode* vn) {
Expand Down
2 changes: 0 additions & 2 deletions src/relay/backend/contrib/cutlass/codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@ class CodegenCutlass : public backend::MemoizedExprTranslator<std::vector<Output

std::vector<Output> VisitExprDefault_(const Object* op) final {
LOG(FATAL) << "Cutlass codegen doesn't support: " << op->GetTypeKey();
return {};
}

std::vector<Output> VisitExpr_(const VarNode* node) final {
Expand Down Expand Up @@ -730,7 +729,6 @@ class CodegenCutlass : public backend::MemoizedExprTranslator<std::vector<Output
}

LOG(FATAL) << "Unknown composite function: " << pattern_name;
return {};
}

GenerateBodyOutput GenerateBody(const CallNode* root_call, const std::string& func_name,
Expand Down
3 changes: 0 additions & 3 deletions src/relay/backend/contrib/dnnl/codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ class CodegenDNNL : public MemoizedExprTranslator<std::vector<Output>>, public C

std::vector<Output> VisitExprDefault_(const Object* op) final {
LOG(FATAL) << "DNNL codegen doesn't support: " << op->GetTypeKey();
return {};
}

std::vector<Output> VisitExpr_(const VarNode* node) final {
Expand Down Expand Up @@ -262,7 +261,6 @@ class CodegenDNNL : public MemoizedExprTranslator<std::vector<Output>>, public C
}

LOG(FATAL) << "Unsupported op: " << AsText(call->op, false);
return {};
}

GenerateBodyOutput GenerateCompositeFunctionCall(const FunctionNode* callee,
Expand All @@ -282,7 +280,6 @@ class CodegenDNNL : public MemoizedExprTranslator<std::vector<Output>>, public C
}

LOG(FATAL) << "Unknown composite function:" << pattern_name;
return {};
}

GenerateBodyOutput GenerateBody(const CallNode* root_call, const std::string& func_name,
Expand Down
8 changes: 0 additions & 8 deletions src/relay/backend/graph_executor_codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,15 +493,12 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<

std::vector<GraphNodeRef> VisitExpr_(const OpNode* op) override {
LOG(FATAL) << "All OpNodes should have been expanded";
return {};
}
std::vector<GraphNodeRef> VisitExpr_(const GlobalVarNode* op) override {
LOG(FATAL) << "All GlobalVarNodes should be removed before graph executor's Codegen is called";
return {};
}
std::vector<GraphNodeRef> VisitExpr_(const IfNode* op) override {
LOG(FATAL) << "Graph executor does not support control flow (found IfNode)";
return {};
}
std::vector<GraphNodeRef> VisitExpr_(const FunctionNode* op) override {
ICHECK(op->GetAttr<String>(attr::kCompiler).defined())
Expand All @@ -510,23 +507,18 @@ class GraphExecutorCodegen : public backend::MemoizedExprTranslator<std::vector<
}
std::vector<GraphNodeRef> VisitExpr_(const RefCreateNode* op) override {
LOG(FATAL) << "Graph executor does not support references (found RefCreateNode)";
return {};
}
std::vector<GraphNodeRef> VisitExpr_(const RefReadNode* op) override {
LOG(FATAL) << "Graph executor does not support references (found RefReadNode)";
return {};
}
std::vector<GraphNodeRef> VisitExpr_(const RefWriteNode* op) override {
LOG(FATAL) << "Graph executor does not support references (found RefWriteNode)";
return {};
}
std::vector<GraphNodeRef> VisitExpr_(const ConstructorNode* op) override {
LOG(FATAL) << "Graph executor does not support ADTs (found ConstructorNode)";
return {};
}
std::vector<GraphNodeRef> VisitExpr_(const MatchNode* op) override {
LOG(FATAL) << "Graph executor does not support matching (found MatchNode)";
return {};
}
/*!
* \brief Generate Graph JSON
Expand Down
Loading