Ignore:
Timestamp:
Mar 22, 2016, 5:14:05 PM (3 years ago)
Author:
nmedfort
Message:

First attempt at dynamic segment size intergration.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.cpp

    r4980 r4986  
    5050#include <llvm/IR/Verifier.h>
    5151#endif
    52 
    53 //#include <llvm/PassManager.h>
    54 //#include <llvm/Transforms/IPO/PassManagerBuilder.h>
    55 
    5652#include <hrtime.h>
    57 
    58 static cl::OptionCategory eIRDumpOptions("LLVM IR Dump Options", "These options control dumping of LLVM IR.");
    59 static cl::opt<bool> DumpGeneratedIR("dump-generated-IR", cl::init(false), cl::desc("Print LLVM IR generated by Pablo Compiler."), cl::cat(eIRDumpOptions));
    60 static cl::opt<std::string> IROutputFilename("dump-generated-IR-output", cl::init(""), cl::desc("output IR filename"), cl::cat(eIRDumpOptions));
    61 
    6253
    6354static cl::OptionCategory fTracingOptions("Run-time Tracing Options", "These options control execution traces.");
     
    10798    #endif
    10899
    109     if (LLVM_UNLIKELY(DumpGeneratedIR)) {
    110 
    111         if (IROutputFilename.empty()) {
    112             mMod->dump();
    113         } else {
    114             std::error_code error;
    115             llvm::raw_fd_ostream out(IROutputFilename, error, sys::fs::OpenFlags::F_None);
    116             mMod->print(out, nullptr);
    117         }
    118     }
    119100    return mFunction;
    120101}
     
    138119
    139120    for (unsigned j = 0; j < function->getNumOfParameters(); ++j) {
    140         mMarkerMap.insert(std::make_pair(function->getParameter(j), mKernelBuilder->getInputStream(j)));
     121        Value * inputVal = mKernelBuilder->getInputStream(j);
     122        if (DumpTrace) {
     123            iBuilder->CallPrintRegister("param" + std::to_string(j + 1), iBuilder->CreateBlockAlignedLoad(inputVal));
     124        }
     125        mMarkerMap.insert(std::make_pair(function->getParameter(j), inputVal));
    141126    }
    142127
Note: See TracChangeset for help on using the changeset viewer.