Ignore:
Timestamp:
May 31, 2017, 4:25:33 PM (23 months ago)
Author:
nmedfort
Message:

Initial attempt to improve debugging capabilities with compilation stack traces on error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_nvptx_builder.cpp

    r5464 r5486  
    1515std::string IDISA_NVPTX20_Builder::getBuilderUniqueName() { return "NVPTX20_" + std::to_string(groupThreads);}
    1616
    17 int IDISA_NVPTX20_Builder::getGroupThreads(){
     17unsigned IDISA_NVPTX20_Builder::getGroupThreads() const{
    1818    return groupThreads;
    1919}
     
    7373        /*Type=*/carryTy,
    7474        /*isConstant=*/false,
    75         /*Linkage=*/llvm::GlobalValue::InternalLinkage,
     75        /*Linkage=*/GlobalValue::InternalLinkage,
    7676        /*Initializer=*/0,
    7777        /*Name=*/"carry",
    7878        /*InsertBefore*/nullptr,
    79         /*TLMode */llvm::GlobalValue::NotThreadLocal,
     79        /*TLMode */GlobalValue::NotThreadLocal,
    8080        /*AddressSpace*/ 3,
    8181        /*isExternallyInitialized*/false);
     
    8686        /*Type=*/bubbleTy,
    8787        /*isConstant=*/false,
    88         /*Linkage=*/llvm::GlobalValue::InternalLinkage,
     88        /*Linkage=*/GlobalValue::InternalLinkage,
    8989        /*Initializer=*/0,
    9090        /*Name=*/"bubble",
    9191        /*InsertBefore*/nullptr,
    92         /*TLMode */llvm::GlobalValue::NotThreadLocal,
     92        /*TLMode */GlobalValue::NotThreadLocal,
    9393        /*AddressSpace*/ 3,
    9494        /*isExternallyInitialized*/false);
     
    215215  Value * bubbleVal = bubbleInitVal;
    216216
    217   for (int offset=groupThreads/2; offset>0; offset=offset>>1){
     217  for (unsigned offset = groupThreads/2; offset>0; offset=offset>>1){
    218218    carryOffsetPtr = CreateGEP(carry, {getInt32(0), CreateXor(id, getInt32(offset))});
    219219    carryVal = CreateOr(carryVal, CreateLoad(carryOffsetPtr));
     
    263263                             "vote.ballot.b32  $0, %p1;}";
    264264    FunctionType * AsmFnTy = FunctionType::get(int32ty, int32ty, false);
    265     llvm::InlineAsm *IA = llvm::InlineAsm::get(AsmFnTy, AsmStream, "=r,r", true, false);
    266     llvm::CallInst * result = CreateCall(IA, conv);
    267     result->addAttribute(llvm::AttributeSet::FunctionIndex, llvm::Attribute::NoUnwind);
     265    InlineAsm *IA = InlineAsm::get(AsmFnTy, AsmStream, "=r,r", true, false);
     266    CallInst * result = CreateCall(IA, conv);
     267    result->addAttribute(AttributeSet::FunctionIndex, Attribute::NoUnwind);
    268268
    269269    CreateRet(result);
     
    271271
    272272LoadInst * IDISA_NVPTX20_Builder::CreateAtomicLoadAcquire(Value * ptr) {
    273     return CreateLoad(ptr);
    274    
    275 }
     273    return CreateLoad(ptr);   
     274}
     275
    276276StoreInst * IDISA_NVPTX20_Builder::CreateAtomicStoreRelease(Value * val, Value * ptr) {
    277277    return CreateStore(val, ptr);
     
    286286}
    287287
    288    
    289 }
     288#ifdef HAS_ADDRESS_SANITIZER
     289LoadInst * IDISA_NVPTX20_Builder::CreateLoad(Value * Ptr, const char * Name) {
     290    return IRBuilder<>::CreateLoad(Ptr, Name);
     291}
     292
     293LoadInst * IDISA_NVPTX20_Builder::CreateLoad(Value * Ptr, const Twine & Name) {
     294    return IRBuilder<>::CreateLoad(Ptr, Name);
     295}
     296
     297LoadInst * IDISA_NVPTX20_Builder::CreateLoad(Type * Ty, Value * Ptr, const Twine & Name) {
     298    return IRBuilder<>::CreateLoad(Ty, Ptr, Name);
     299}
     300
     301LoadInst * IDISA_NVPTX20_Builder::CreateLoad(Value * Ptr, bool isVolatile, const Twine & Name) {
     302    return IRBuilder<>::CreateLoad(Ptr, isVolatile, Name);
     303}
     304
     305StoreInst * IDISA_NVPTX20_Builder::CreateStore(Value * Val, Value * Ptr, bool isVolatile) {
     306    return IRBuilder<>::CreateStore(Val, Ptr, isVolatile);
     307}
     308#endif
     309
     310}
Note: See TracChangeset for help on using the changeset viewer.