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
2 changes: 2 additions & 0 deletions src/codegen/llvm/codegen_cpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,11 @@ void CodeGenCPU::CreateComputeScope(const AttrStmt* op) {
// set non alias.
#if TVM_LLVM_VERSION >= 50
fcompute->addParamAttr(idx + 1, llvm::Attribute::NoAlias);
// always not inline compute function to make the code structure clean
#else
fcompute->setDoesNotAlias(idx + 1);
#endif
fcompute->addFnAttr(llvm::Attribute::NoInline);
}
}
std::swap(function_, fcompute);
Expand Down
9 changes: 5 additions & 4 deletions src/pass/make_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ LoweredFunc MakeAPI(Stmt body,
args.push_back(v_packed_arg_type_ids);
args.push_back(v_num_packed_args);
std::ostringstream os;
os << "expected num_args to be " << num_packed_args;

os << name << ": num_args should be " << num_packed_args;
seq_init.emplace_back(
MakeAssertEQ(v_num_packed_args, num_packed_args, os.str()));
}
Expand All @@ -98,19 +99,19 @@ LoweredFunc MakeAPI(Stmt body,
Type t = v_arg.type();
if (t.is_handle()) {
std::ostringstream msg;
msg << "Expect argument " << i << " to be pointer";
msg << name << ": Expect arg[" << i << "] to be pointer";
seq_check.emplace_back(
AssertStmt::make(tcode == kHandle ||
tcode == kArrayHandle ||
tcode == kNull, msg.str(), nop));
} else if (t.is_int() || t.is_uint()) {
std::ostringstream msg;
msg << "Expect argument " << i << " to be int";
msg << name << ": Expect arg[" << i << "] to be int";
seq_check.emplace_back(AssertStmt::make(tcode == kInt, msg.str(), nop));
} else {
CHECK(t.is_float());
std::ostringstream msg;
msg << "Expect argument " << i << " to be float";
msg << name << ": Expect arg[" << i << "] to be float";
seq_check.emplace_back(AssertStmt::make(tcode == kFloat, msg.str(), nop));
}
} else {
Expand Down