fixed the code that non-task code is also emitted for the host
This commit is contained in:
6
func.cpp
6
func.cpp
@@ -527,17 +527,17 @@ Function::GenerateIR() {
|
|||||||
const FunctionType *func_type= CastType<FunctionType>(sym->type);
|
const FunctionType *func_type= CastType<FunctionType>(sym->type);
|
||||||
if (g->target->getISA() == Target::NVPTX64 && func_type->isExported)
|
if (g->target->getISA() == Target::NVPTX64 && func_type->isExported)
|
||||||
return;
|
return;
|
||||||
if (g->target->getISA() != Target::NVPTX64 && g->target->isPTX() && !func_type->isExported)
|
if (g->target->getISA() != Target::NVPTX64 && g->target->isPTX() && func_type->isTask)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(g->target->getISA() && func_type->isExported))
|
// if (!(g->target->getISA()==Target::NVPTX64 && func_type->isExported))
|
||||||
{
|
{
|
||||||
FunctionEmitContext ec(this, sym, function, firstStmtPos);
|
FunctionEmitContext ec(this, sym, function, firstStmtPos);
|
||||||
emitCode(&ec, function, firstStmtPos);
|
emitCode(&ec, function, firstStmtPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m->errorCount == 0) {
|
if (m->errorCount == 0) {
|
||||||
if (!(g->target->getISA() && func_type->isExported))
|
// if (!(g->target->getISA() == Target::NVPTX64 && func_type->isExported))
|
||||||
if (llvm::verifyFunction(*function, llvm::ReturnStatusAction) == true) {
|
if (llvm::verifyFunction(*function, llvm::ReturnStatusAction) == true) {
|
||||||
if (g->debugPrint)
|
if (g->debugPrint)
|
||||||
function->dump();
|
function->dump();
|
||||||
|
|||||||
Reference in New Issue
Block a user