Skip to content
Snippets Groups Projects
Commit 57c212bf authored by Maria Kotsifakou's avatar Maria Kotsifakou
Browse files

Fixed DFG2LLVM_SPIR bug

parents 4354db7d 72fb81ad
No related branches found
No related tags found
No related merge requests found
...@@ -1011,6 +1011,9 @@ void CGT_SPIR::codeGen(DFLeafNode* N) { ...@@ -1011,6 +1011,9 @@ void CGT_SPIR::codeGen(DFLeafNode* N) {
transformFunctionToVoid(F_spir); transformFunctionToVoid(F_spir);
removeInOutAttributes(F_spir); removeInOutAttributes(F_spir);
DEBUG(errs() << "Removing all attributes from Kernel Function and adding nounwind\n");
F_spir->removeAttributes(AttributeSet::FunctionIndex, F_spir->getAttributes().getFnAttributes());
F_spir->addAttribute(AttributeSet::FunctionIndex, Attribute::NoUnwind);
//FIXME: For now, assume only one allocation node //FIXME: For now, assume only one allocation node
kernel->AllocationNode = NULL; kernel->AllocationNode = NULL;
...@@ -1590,6 +1593,10 @@ void CGT_SPIR::writeKernelsModule() { ...@@ -1590,6 +1593,10 @@ void CGT_SPIR::writeKernelsModule() {
errs() << "Writing to File --- "; errs() << "Writing to File --- ";
errs() << getSPIRFilename(M).c_str() << "\n"; errs() << getSPIRFilename(M).c_str() << "\n";
WriteBitcodeToFile(unwrap(KernelMRef), OS); WriteBitcodeToFile(unwrap(KernelMRef), OS);
//ErrorMessage = LLVMWriteBitcodeToFile(KernelMRef, getSPIRFilename(M).c_str());
//LLVMPrintModuleToFile(KernelMRef,
//getKernelsModuleName(M).c_str(),
//&ErrorMessage);
//if (ErrorMessage) { //if (ErrorMessage) {
//llvm_unreachable("Error: Unable to write kernel module to file\n"); //llvm_unreachable("Error: Unable to write kernel module to file\n");
......
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