Ignore:
Timestamp:
May 16, 2017, 4:13:53 PM (2 years ago)
Author:
nmedfort
Message:

Bug fix check in for DumpTrace?, compilation of DoBlock? / DoFinalBlock? functions. Pablo CodeMotionPass? optimized and enabled by default.

File:
1 edited

Legend:

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

    r5440 r5454  
    427427    len = CreateZExtOrTrunc(len, sizeTy);
    428428    if (codegen::EnableAsserts) {
     429        DataLayout DL(getModule());
     430        IntegerType * const intPtrTy = getIntPtrTy(DL);
    429431        CreateAssert(len, "CreateMUnmap: length cannot be 0");
    430         Value * const addrValue = CreatePtrToInt(addr, sizeTy);
    431         Value * const pageOffset = CreateURem(addrValue, getSize(getpagesize()));
    432         CreateAssert(CreateICmpEQ(pageOffset, getSize(0)), "CreateMUnmap: addr must be a multiple of the page size");
    433         Value * const boundCheck = CreateICmpULT(addrValue, CreateSub(ConstantInt::getAllOnesValue(sizeTy), len));
     432        Value * const addrValue = CreatePtrToInt(addr, intPtrTy);
     433        Value * const pageOffset = CreateURem(addrValue, ConstantInt::get(intPtrTy, getpagesize()));
     434        CreateAssert(CreateICmpEQ(pageOffset, ConstantInt::getNullValue(intPtrTy)), "CreateMUnmap: addr must be a multiple of the page size");
     435        Value * const boundCheck = CreateICmpULT(addrValue, CreateSub(ConstantInt::getAllOnesValue(intPtrTy), CreateZExtOrTrunc(len, intPtrTy)));
    434436        CreateAssert(boundCheck, "CreateMUnmap: addresses in [addr, addr+len) are outside the valid address space range");
    435437    }
Note: See TracChangeset for help on using the changeset viewer.