Skip to content
Snippets Groups Projects
Commit c773999d authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Merge branch 'update_debugging_SupportHPVM' into 'hpvm-release-exp'

Update debugging support hpvm

See merge request llvm/hpvm!19
parents 641618d5 d3670c76
No related branches found
No related tags found
No related merge requests found
......@@ -291,6 +291,7 @@ Function *CodeGenTraversal::addArgument(Function *F, Type *Ty,
// Return new function with additional index and limit arguments.
// The original function is removed from the module and erased.
Function *CodeGenTraversal::addIdxDimArgs(Function *F) {
DEBUG(errs() << "Adding dimension and limit arguments to Function: " << F->getName());
DEBUG(errs() << "Function Type: " << *F->getFunctionType() << "\n");
// Add Index and Dim arguments
std::string names[] = {"idx_x", "idx_y", "idx_z", "dim_x", "dim_y", "dim_z"};
......
......@@ -175,14 +175,15 @@ void replaceNodeFunctionInIR(Module &M, Function *F, Function *G) {
continue;
// Otherwise, replace F with G
DEBUG(errs() << *G->getType() << "\n");
DEBUG(errs() << *CI->getArgOperand(1)->getType() << "\n");
DEBUG(errs() << "Fixing use: " << *CI << "\n");
DEBUG(errs() << "in function: " << Func.getName() << "\n");
CI->setArgOperand(1, G);
DEBUG(errs() << "Fixed use: " << *CI << "\n");
}
}
for (auto I : toBeErased) {
DEBUG(errs() << "\tErasing " << *I << "\n");
DEBUG(errs() << "\tErasing Instruction: " << *I << "\n");
I->eraseFromParent();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment