Lines Matching refs:CS
180 static bool isGCLeafFunction(const CallSite &CS);
182 static bool needsStatepoint(const CallSite &CS) { in needsStatepoint() argument
183 if (isGCLeafFunction(CS)) in needsStatepoint()
185 if (CS.isCall()) { in needsStatepoint()
186 CallInst *call = cast<CallInst>(CS.getInstruction()); in needsStatepoint()
190 if (isStatepoint(CS) || isGCRelocate(CS) || isGCResult(CS)) { in needsStatepoint()
196 static Value *ReplaceWithStatepoint(const CallSite &CS, Pass *P);
220 if (auto CS = CallSite(&I)) in containsUnconditionalCallSafepoint() local
227 if (needsStatepoint(CS)) in containsUnconditionalCallSafepoint()
466 CallSite CS(inst); in findCallSafepoints() local
469 if (!needsStatepoint(CS)) { in findCallSafepoints()
473 Found.push_back(CS); in findCallSafepoints()
669 CallSite &CS = ParsePointNeeded[i]; in runOnFunction() local
670 Value *GCResult = ReplaceWithStatepoint(CS, nullptr); in runOnFunction()
677 CallSite &CS = ParsePointNeeded[i]; in runOnFunction() local
688 if (CS.isInvoke()) { in runOnFunction()
696 CS.getInstruction()->replaceAllUsesWith(GCResult); in runOnFunction()
701 CS.getInstruction()->eraseFromParent(); in runOnFunction()
725 static bool isGCLeafFunction(const CallSite &CS) { in INITIALIZE_PASS_DEPENDENCY()
726 Instruction *inst = CS.getInstruction(); in INITIALIZE_PASS_DEPENDENCY()
740 const Function *F = CS.getCalledFunction(); in INITIALIZE_PASS_DEPENDENCY()
863 static Value *ReplaceWithStatepoint(const CallSite &CS, /* to replace */ in ReplaceWithStatepoint() argument
865 BasicBlock *BB = CS.getInstruction()->getParent(); in ReplaceWithStatepoint()
879 Instruction *insertBefore = CS.getInstruction(); in ReplaceWithStatepoint()
888 if (CS.isCall()) { in ReplaceWithStatepoint()
889 CallInst *toReplace = cast<CallInst>(CS.getInstruction()); in ReplaceWithStatepoint()
891 CS.getCalledValue(), makeArrayRef(CS.arg_begin(), CS.arg_end()), None, in ReplaceWithStatepoint()
915 } else if (CS.isInvoke()) { in ReplaceWithStatepoint()
922 argTypes.push_back(CS.getCalledValue()->getType()); in ReplaceWithStatepoint()
931 Value *Target = CS.getCalledValue(); in ReplaceWithStatepoint()
933 int callArgSize = CS.arg_size(); in ReplaceWithStatepoint()
939 args.insert(args.end(), CS.arg_begin(), CS.arg_end()); in ReplaceWithStatepoint()
943 InvokeInst *toReplace = cast<InvokeInst>(CS.getInstruction()); in ReplaceWithStatepoint()
977 if (!CS.getType()->isVoidTy() && !CS.getInstruction()->use_empty()) { in ReplaceWithStatepoint()
979 CS.getInstruction()->hasName() ? CS.getInstruction()->getName() : ""; in ReplaceWithStatepoint()
981 Builder.CreateGCResult(token, CS.getType(), takenName); in ReplaceWithStatepoint()