Beispiel #1
0
/*!
 * Add indirect uses an memory object in the function
 */
bool MRGenerator::addRefSideEffectOfCallSite(llvm::CallSite cs, const NodeBS& refs) {
    if(!refs.empty()) {
        NodeBS refset = refs;
        refset &= getCallSitePts(cs);
        getGlobalsAndHeapFromPts(refset,refs);
        addRefSideEffectOfFunction(cs.getCaller(),refset);
        return csToRefsMap[cs] |= refset;
    }
    return false;
}
Beispiel #2
0
/*!
 * Add indirect def an memory object in the function
 */
bool MRGenerator::addModSideEffectOfCallSite(llvm::CallSite cs, const NodeBS& mods) {
    if(!mods.empty()) {
        NodeBS modset = mods;
        modset &= getCallSitePts(cs);
        getGlobalsAndHeapFromPts(modset,mods);
        addModSideEffectOfFunction(cs.getCaller(),modset);
        return csToModsMap[cs] |= modset;
    }
    return false;
}
Beispiel #3
0
llvm::InlineCost ExtremeInliner::getInlineCost(llvm::CallSite callSite)
{
    llvm::Function *caller = callSite.getCaller();

    if (caller != m_function) {
        return llvm::InlineCost::getNever();
    }

    const llvm::Type *type = callSite.getType();
    if (!m_inlineVoids && (type->isVoidTy() || type->isFloatTy() || type->isDoubleTy() || llvm::isa<llvm::PointerType>(type))) {
        return llvm::InlineCost::getNever();
    }

    return llvm::InlineCost::getAlways();
}