Ignore:
Timestamp:
Jun 6, 2017, 6:20:55 PM (2 years ago)
Author:
cameron
Message:

Restore check-ins from the last several days

File:
1 edited

Legend:

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

    r5489 r5493  
    372372}
    373373
    374 LoadInst * IDISA_Builder::CreateBlockAlignedLoad(Value * const ptr) {
    375     const auto alignment = mBitBlockWidth / 8;
    376     if (codegen::EnableAsserts) {
    377         DataLayout DL(getModule());
    378         IntegerType * const intPtrTy = getIntPtrTy(DL);
    379         Value * alignmentOffset = CreateURem(CreatePtrToInt(ptr, intPtrTy), ConstantInt::get(intPtrTy, alignment));
    380         Value * alignmentCheck = CreateICmpEQ(alignmentOffset, ConstantInt::getNullValue(intPtrTy));
    381         CreateAssert(alignmentCheck, "CreateBlockAlignedLoad: pointer is unaligned");
    382     }
    383     return CreateAlignedLoad(ptr, alignment);
    384 }
    385 
    386 void IDISA_Builder::CreateBlockAlignedStore(Value * const value, Value * const ptr) {
    387     const auto alignment = mBitBlockWidth / 8;
    388     if (codegen::EnableAsserts) {
    389         DataLayout DL(getModule());
    390         IntegerType * const intPtrTy = getIntPtrTy(DL);
    391         Value * alignmentOffset = CreateURem(CreatePtrToInt(ptr, intPtrTy), ConstantInt::get(intPtrTy, alignment));
    392         Value * alignmentCheck = CreateICmpEQ(alignmentOffset, ConstantInt::getNullValue(intPtrTy));
    393         CreateAssert(alignmentCheck, "CreateBlockAlignedStore: pointer is not aligned");
    394     }
    395     CreateAlignedStore(value, ptr, alignment);
    396 }
    397 
    398374IDISA_Builder::IDISA_Builder(llvm::LLVMContext & C, unsigned vectorWidth, unsigned stride)
    399375: CBuilder(C)
Note: See TracChangeset for help on using the changeset viewer.