Changeset 5461


Ignore:
Timestamp:
May 19, 2017, 3:50:39 PM (2 years ago)
Author:
lindanl
Message:

Optimize compilation for NVPTX driver.

Location:
icGREP/icgrep-devel/icgrep
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IR_Gen/llvm2ptx.h

    r5458 r5461  
    1919using namespace llvm;
    2020
    21 static int llvm2ptx(std::string IRFilename, std::string PTXFilename) {
     21static int llvm2ptx(Module * M, std::string PTXFilename) {
    2222
    2323  LLVMContext Context;
    24 
    25   // Load the module to be compiled...
    2624  SMDiagnostic Err;
    27   std::unique_ptr<Module> M;
    2825  std::unique_ptr<MIRParser> MIR;
    2926  Triple TheTriple;
    30 
    31   M = parseIRFile(IRFilename, Err, Context);
    32   if (!M) {
    33     errs() << IRFilename << ": Cannot parse input file!\n";
    34     return 1;
    35   }
    3627
    3728#ifndef NDEBUG
  • icGREP/icgrep-devel/icgrep/toolchain/NVPTXDriver.cpp

    r5458 r5461  
    111111}
    112112
    113 void NVPTXDriver::finalizeAndCompile(Function * mainFunc, std::string IRFilename, std::string PTXFilename) {
     113void NVPTXDriver::finalizeAndCompile(Function * mainFunc, std::string PTXFilename) {
    114114
    115115    legacy::PassManager PM;
     
    134134    PM.run(*mMainModule); 
    135135
    136     std::error_code error;
    137     raw_fd_ostream out(IRFilename, error, sys::fs::OpenFlags::F_None);
    138     mMainModule->print(out, nullptr);
    139 
    140136    if (LLVM_UNLIKELY(codegen::DebugOptionIsSet(codegen::ShowIR)))
    141137            mMainModule->dump();
    142138
    143     llvm2ptx(IRFilename, PTXFilename);
     139    llvm2ptx(mMainModule, PTXFilename);
    144140}
    145141
Note: See TracChangeset for help on using the changeset viewer.