Lines Matching refs:Call

162   void traceAICall(CallInst *Call, CallInfo &ParentInfo);
169 bool IsPreserveDIAccessIndexCall(const CallInst *Call, CallInfo &Cinfo);
182 Value *computeBaseAndAccessKey(CallInst *Call, CallInfo &CInfo,
184 MDNode *computeAccessKey(CallInst *Call, CallInfo &CInfo,
187 bool transformGEPChain(CallInst *Call, CallInfo &CInfo);
349 static Type *getBaseElementType(const CallInst *Call) { in getBaseElementType() argument
351 return Call->getParamElementType(0); in getBaseElementType()
355 bool BPFAbstractMemberAccess::IsPreserveDIAccessIndexCall(const CallInst *Call, in IsPreserveDIAccessIndexCall() argument
357 if (!Call) in IsPreserveDIAccessIndexCall()
360 const auto *GV = dyn_cast<GlobalValue>(Call->getCalledOperand()); in IsPreserveDIAccessIndexCall()
365 CInfo.Metadata = Call->getMetadata(LLVMContext::MD_preserve_access_index); in IsPreserveDIAccessIndexCall()
368 CInfo.AccessIndex = getConstant(Call->getArgOperand(2)); in IsPreserveDIAccessIndexCall()
369 CInfo.Base = Call->getArgOperand(0); in IsPreserveDIAccessIndexCall()
370 CInfo.RecordAlignment = DL->getABITypeAlign(getBaseElementType(Call)); in IsPreserveDIAccessIndexCall()
375 CInfo.Metadata = Call->getMetadata(LLVMContext::MD_preserve_access_index); in IsPreserveDIAccessIndexCall()
379 CInfo.AccessIndex = getConstant(Call->getArgOperand(1)); in IsPreserveDIAccessIndexCall()
380 CInfo.Base = Call->getArgOperand(0); in IsPreserveDIAccessIndexCall()
385 CInfo.Metadata = Call->getMetadata(LLVMContext::MD_preserve_access_index); in IsPreserveDIAccessIndexCall()
389 CInfo.AccessIndex = getConstant(Call->getArgOperand(2)); in IsPreserveDIAccessIndexCall()
390 CInfo.Base = Call->getArgOperand(0); in IsPreserveDIAccessIndexCall()
391 CInfo.RecordAlignment = DL->getABITypeAlign(getBaseElementType(Call)); in IsPreserveDIAccessIndexCall()
398 uint64_t InfoKind = getConstant(Call->getArgOperand(1)); in IsPreserveDIAccessIndexCall()
406 CInfo.Metadata = Call->getMetadata(LLVMContext::MD_preserve_access_index); in IsPreserveDIAccessIndexCall()
409 uint64_t Flag = getConstant(Call->getArgOperand(1)); in IsPreserveDIAccessIndexCall()
422 CInfo.Metadata = Call->getMetadata(LLVMContext::MD_preserve_access_index); in IsPreserveDIAccessIndexCall()
425 uint64_t Flag = getConstant(Call->getArgOperand(2)); in IsPreserveDIAccessIndexCall()
441 for (auto Call : CallList) { in replaceWithGEP() local
444 Dimension = getConstant(Call->getArgOperand(DimensionIndex)); in replaceWithGEP()
447 ConstantInt::get(Type::getInt32Ty(Call->getParent()->getContext()), 0); in replaceWithGEP()
451 IdxList.push_back(Call->getArgOperand(GEPIndex)); in replaceWithGEP()
454 getBaseElementType(Call), Call->getArgOperand(0), IdxList, "", Call); in replaceWithGEP()
455 Call->replaceAllUsesWith(GEP); in replaceWithGEP()
456 Call->eraseFromParent(); in replaceWithGEP()
468 auto *Call = dyn_cast<CallInst>(&I); in removePreserveAccessIndexIntrinsic() local
470 if (!IsPreserveDIAccessIndexCall(Call, CInfo)) in removePreserveAccessIndexIntrinsic()
475 PreserveArrayIndexCalls.push_back(Call); in removePreserveAccessIndexIntrinsic()
477 PreserveUnionIndexCalls.push_back(Call); in removePreserveAccessIndexIntrinsic()
479 PreserveStructIndexCalls.push_back(Call); in removePreserveAccessIndexIntrinsic()
494 for (auto Call : PreserveUnionIndexCalls) { in removePreserveAccessIndexIntrinsic() local
495 Call->replaceAllUsesWith(Call->getArgOperand(0)); in removePreserveAccessIndexIntrinsic()
496 Call->eraseFromParent(); in removePreserveAccessIndexIntrinsic()
554 void BPFAbstractMemberAccess::traceAICall(CallInst *Call, in traceAICall() argument
556 for (User *U : Call->users()) { in traceAICall()
562 traceBitCast(BI, Call, ParentInfo); in traceAICall()
569 AIChain[CI] = std::make_pair(Call, ParentInfo); in traceAICall()
572 BaseAICalls[Call] = ParentInfo; in traceAICall()
576 traceGEP(GI, Call, ParentInfo); in traceAICall()
578 BaseAICalls[Call] = ParentInfo; in traceAICall()
580 BaseAICalls[Call] = ParentInfo; in traceAICall()
653 auto *Call = dyn_cast<CallInst>(&I); in collectAICallChains() local
654 if (!IsPreserveDIAccessIndexCall(Call, CInfo) || in collectAICallChains()
655 AIChain.find(Call) != AIChain.end()) in collectAICallChains()
658 traceAICall(Call, CInfo); in collectAICallChains()
852 Value *BPFAbstractMemberAccess::computeBaseAndAccessKey(CallInst *Call, in computeBaseAndAccessKey() argument
861 while (Call) { in computeBaseAndAccessKey()
862 CallStack.push(std::make_pair(Call, CInfo)); in computeBaseAndAccessKey()
863 CInfo = AIChain[Call].second; in computeBaseAndAccessKey()
864 Call = AIChain[Call].first; in computeBaseAndAccessKey()
882 Call = StackElem.first; in computeBaseAndAccessKey()
1008 MDNode *BPFAbstractMemberAccess::computeAccessKey(CallInst *Call, in computeAccessKey() argument
1032 cast<GlobalVariable>(Call->getArgOperand(1)->stripPointerCasts()); in computeAccessKey()
1073 bool BPFAbstractMemberAccess::transformGEPChain(CallInst *Call, in transformGEPChain() argument
1082 TypeMeta = computeAccessKey(Call, CInfo, AccessKey, IsInt32Ret); in transformGEPChain()
1084 Base = computeBaseAndAccessKey(Call, CInfo, AccessKey, TypeMeta); in transformGEPChain()
1089 BasicBlock *BB = Call->getParent(); in transformGEPChain()
1112 LDInst = new LoadInst(Type::getInt32Ty(BB->getContext()), GV, "", Call); in transformGEPChain()
1114 LDInst = new LoadInst(Type::getInt64Ty(BB->getContext()), GV, "", Call); in transformGEPChain()
1117 BPFCoreSharedInfo::insertPassThrough(M, BB, LDInst, Call); in transformGEPChain()
1118 Call->replaceAllUsesWith(PassThroughInst); in transformGEPChain()
1119 Call->eraseFromParent(); in transformGEPChain()
1134 auto *LDInst = new LoadInst(Type::getInt64Ty(BB->getContext()), GV, "", Call); in transformGEPChain()
1138 BB->getInstList().insert(Call->getIterator(), BCInst); in transformGEPChain()
1143 BB->getInstList().insert(Call->getIterator(), GEP); in transformGEPChain()
1146 auto *BCInst2 = new BitCastInst(GEP, Call->getType()); in transformGEPChain()
1147 BB->getInstList().insert(Call->getIterator(), BCInst2); in transformGEPChain()
1195 BPFCoreSharedInfo::insertPassThrough(M, BB, BCInst2, Call); in transformGEPChain()
1196 Call->replaceAllUsesWith(PassThroughInst); in transformGEPChain()
1197 Call->eraseFromParent(); in transformGEPChain()