Lines Matching defs:CS

103   bool simplifyCallSite(Function *F, CallSite CS);
134 bool visitCallSite(CallSite CS);
149 bool analyzeCall(CallSite CS);
677 bool CallAnalyzer::simplifyCallSite(Function *F, CallSite CS) {
687 ConstantArgs.reserve(CS.arg_size());
688 for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end();
699 SimplifiedValues[CS.getInstruction()] = C;
706 bool CallAnalyzer::visitCallSite(CallSite CS) {
707 if (CS.isCall() && cast<CallInst>(CS.getInstruction())->canReturnTwice() &&
714 if (CS.isCall() &&
715 cast<CallInst>(CS.getInstruction())->hasFnAttr(Attribute::NoDuplicate))
718 if (Function *F = CS.getCalledFunction()) {
720 if (simplifyCallSite(F, CS))
725 if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(CS.getInstruction())) {
728 return Base::visitCallSite(CS);
738 if (F == CS.getInstruction()->getParent()->getParent()) {
748 Cost += CS.arg_size() * InlineConstants::InstrCost;
752 if (!isa<InlineAsm>(CS.getCalledValue()))
756 return Base::visitCallSite(CS);
761 Value *Callee = CS.getCalledValue();
765 Cost += CS.arg_size() * InlineConstants::InstrCost;
771 return Base::visitCallSite(CS);
779 if (CA.analyzeCall(CS)) {
785 return Base::visitCallSite(CS);
899 bool CallAnalyzer::analyzeCall(CallSite CS) {
922 for (unsigned I = 0, E = CS.arg_size(); I != E; ++I) {
923 if (TD && CS.isByValArgument(I)) {
926 PointerType *PTy = cast<PointerType>(CS.getArgument(I)->getType());
951 &F == CS.getCalledFunction();
959 Instruction *Instr = CS.getInstruction();
978 Function *Caller = CS.getInstruction()->getParent()->getParent();
998 CallSite::arg_iterator CAI = CS.arg_begin();
1001 assert(CAI != CS.arg_end());
1170 InlineCost InlineCostAnalysis::getInlineCost(CallSite CS, int Threshold) {
1171 return getInlineCost(CS, CS.getCalledFunction(), Threshold);
1174 InlineCost InlineCostAnalysis::getInlineCost(CallSite CS, Function *Callee,
1195 CS.isNoInline())
1202 bool ShouldInline = CA.analyzeCall(CS);
1226 CallSite CS(II);
1227 if (!CS)
1231 if (&F == CS.getCalledFunction())
1236 if (!ReturnsTwice && CS.isCall() &&
1237 cast<CallInst>(CS.getInstruction())->canReturnTwice())