Lines Matching defs:CI

203 Instruction *InstCombiner::visitCallInst(CallInst &CI) {
204 if (isFreeCall(&CI, TLI))
205 return visitFree(CI);
209 if (CI.getParent()->getParent()->doesNotThrow() &&
210 !CI.doesNotThrow()) {
211 CI.setDoesNotThrow();
212 return &CI;
215 IntrinsicInst *II = dyn_cast<IntrinsicInst>(&CI);
216 if (!II) return visitCallSite(&CI);
226 return EraseInstFromFunction(CI);
228 if (ConstantInt *CI = dyn_cast<ConstantInt>(NumBytes))
229 if (CI->getZExtValue() == 1) {
246 Module *M = CI.getParent()->getParent()->getParent();
248 Type *Tys[3] = { CI.getArgOperand(0)->getType(),
249 CI.getArgOperand(1)->getType(),
250 CI.getArgOperand(2)->getType() };
251 CI.setCalledFunction(Intrinsic::getDeclaration(M, MemCpyID, Tys));
259 return EraseInstFromFunction(CI);
280 return ReplaceInstUsesWith(CI, ConstantInt::get(CI.getType(), Size));
289 return ReplaceInstUsesWith(CI, X);
306 return ReplaceInstUsesWith(CI, ConstantFP::get(CI.getType(), 1.0));
309 return ReplaceInstUsesWith(CI, II->getArgOperand(0));
312 return BinaryOperator::CreateFDiv(ConstantFP::get(CI.getType(), 1.0),
329 return ReplaceInstUsesWith(CI, ConstantInt::get(IT,
347 return ReplaceInstUsesWith(CI, ConstantInt::get(IT,
372 Add->takeName(&CI);
386 Add->takeName(&CI);
410 return ReplaceInstUsesWith(CI, UndefValue::get(II->getType()));
431 Add->takeName(&CI);
446 return ReplaceInstUsesWith(CI, UndefValue::get(II->getType()));
502 return ReplaceInstUsesWith(CI, UndefValue::get(II->getType()));
507 return ReplaceInstUsesWith(CI, Constant::getNullValue(II->getType()));
618 CI, ConstantAggregateZero::get(Vec->getType()));
680 CI,
723 Module *M = CI.getParent()->getParent()->getParent();
726 return ReplaceInstUsesWith(CI, Builder->CreateCall(F, Args));
813 return ReplaceInstUsesWith(CI, Shuffle);
870 return CastInst::Create(Instruction::BitCast, Result, CI.getType());
910 return ReplaceInstUsesWith(CI, ConstantAggregateZero::get(II->getType()));
922 return ReplaceInstUsesWith(CI, ConstantExpr::getMul(CV0, CV1));
949 return ReplaceInstUsesWith(CI, ConstantFP::get(II->getContext(), Val));
961 return EraseInstFromFunction(CI);
979 return EraseInstFromFunction(CI);
994 return EraseInstFromFunction(CI);
1011 const CastInst * const CI,
1014 if (!CI->isLosslessCast())
1024 cast<PointerType>(CI->getOperand(0)->getType())->getElementType();
1025 Type* DstTy = cast<PointerType>(CI->getType())->getElementType();
1037 Instruction *InstCombiner::tryOptimizeCall(CallInst *CI, const DataLayout *DL) {
1038 if (!CI->getCalledFunction()) return nullptr;
1040 if (Value *With = Simplifier->optimizeCall(CI)) {
1042 return CI->use_empty() ? CI : ReplaceInstUsesWith(*CI, With);
1197 CastInst *CI = dyn_cast<CastInst>(*I);
1198 if (CI && isSafeToEliminateVarargsCast(CS, CI, DL, ix)) {
1199 *I = CI->getOperand(0);
1214 if (CallInst *CI = dyn_cast<CallInst>(CS.getInstruction())) {
1215 Instruction *I = tryOptimizeCall(CI, DL);
1442 CallInst *CI = cast<CallInst>(Caller);
1444 NC->takeName(CI);
1445 if (CI->isTailCall())
1447 cast<CallInst>(NC)->setCallingConv(CI->getCallingConv());