Lines Matching refs:II

215   IntrinsicInst *II = dyn_cast<IntrinsicInst>(&CI);
216 if (!II) return visitCallSite(&CI);
220 if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(II)) {
272 if (Changed) return II;
275 switch (II->getIntrinsicID()) {
279 if (getObjectSize(II->getArgOperand(0), Size, DL, TLI))
284 Value *IIOperand = II->getArgOperand(0);
303 if (ConstantInt *Power = dyn_cast<ConstantInt>(II->getArgOperand(1))) {
309 return ReplaceInstUsesWith(CI, II->getArgOperand(0));
313 II->getArgOperand(0));
319 IntegerType *IT = dyn_cast<IntegerType>(II->getArgOperand(0)->getType());
325 computeKnownBits(II->getArgOperand(0), KnownZero, KnownOne);
337 IntegerType *IT = dyn_cast<IntegerType>(II->getArgOperand(0)->getType());
343 computeKnownBits(II->getArgOperand(0), KnownZero, KnownOne);
353 Value *LHS = II->getArgOperand(0), *RHS = II->getArgOperand(1);
354 IntegerType *IT = cast<IntegerType>(II->getArgOperand(0)->getType());
375 ConstantInt::getTrue(II->getContext())
377 StructType *ST = cast<StructType>(II->getType());
389 ConstantInt::getFalse(II->getContext())
391 StructType *ST = cast<StructType>(II->getType());
400 if (isa<Constant>(II->getArgOperand(0)) &&
401 !isa<Constant>(II->getArgOperand(1))) {
402 Value *LHS = II->getArgOperand(0);
403 II->setArgOperand(0, II->getArgOperand(1));
404 II->setArgOperand(1, LHS);
405 return II;
409 if (isa<UndefValue>(II->getArgOperand(1)))
410 return ReplaceInstUsesWith(CI, UndefValue::get(II->getType()));
412 if (ConstantInt *RHS = dyn_cast<ConstantInt>(II->getArgOperand(1))) {
416 UndefValue::get(II->getArgOperand(0)->getType()),
417 ConstantInt::getFalse(II->getContext())
420 ConstantStruct::get(cast<StructType>(II->getType()), V);
421 return InsertValueInst::Create(Struct, II->getArgOperand(0), 0);
427 if (II->getIntrinsicID() == Intrinsic::sadd_with_overflow) {
428 Value *LHS = II->getArgOperand(0), *RHS = II->getArgOperand(1);
433 StructType *ST = cast<StructType>(II->getType());
444 if (isa<UndefValue>(II->getArgOperand(0)) ||
445 isa<UndefValue>(II->getArgOperand(1)))
446 return ReplaceInstUsesWith(CI, UndefValue::get(II->getType()));
448 if (ConstantInt *RHS = dyn_cast<ConstantInt>(II->getArgOperand(1))) {
452 UndefValue::get(II->getArgOperand(0)->getType()),
453 ConstantInt::getFalse(II->getContext())
456 ConstantStruct::get(cast<StructType>(II->getType()), V);
457 return InsertValueInst::Create(Struct, II->getArgOperand(0), 0);
462 Value *LHS = II->getArgOperand(0), *RHS = II->getArgOperand(1);
486 Constant *Struct = ConstantStruct::get(cast<StructType>(II->getType()),V);
492 if (isa<Constant>(II->getArgOperand(0)) &&
493 !isa<Constant>(II->getArgOperand(1))) {
494 Value *LHS = II->getArgOperand(0);
495 II->setArgOperand(0, II->getArgOperand(1));
496 II->setArgOperand(1, LHS);
497 return II;
501 if (isa<UndefValue>(II->getArgOperand(1)))
502 return ReplaceInstUsesWith(CI, UndefValue::get(II->getType()));
504 if (ConstantInt *RHSI = dyn_cast<ConstantInt>(II->getArgOperand(1))) {
507 return ReplaceInstUsesWith(CI, Constant::getNullValue(II->getType()));
512 UndefValue::get(II->getArgOperand(0)->getType()),
513 ConstantInt::getFalse(II->getContext())
516 ConstantStruct::get(cast<StructType>(II->getType()), V);
517 return InsertValueInst::Create(Struct, II->getArgOperand(0), 0);
524 if (getOrEnforceKnownAlignment(II->getArgOperand(0), 16, DL) >= 16) {
525 Value *Ptr = Builder->CreateBitCast(II->getArgOperand(0),
526 PointerType::getUnqual(II->getType()));
533 if (getOrEnforceKnownAlignment(II->getArgOperand(1), 16, DL) >= 16) {
535 PointerType::getUnqual(II->getArgOperand(0)->getType());
536 Value *Ptr = Builder->CreateBitCast(II->getArgOperand(1), OpPtrTy);
537 return new StoreInst(II->getArgOperand(0), Ptr);
544 if (getOrEnforceKnownAlignment(II->getArgOperand(0), 16, DL) >= 16) {
546 PointerType::getUnqual(II->getArgOperand(1)->getType());
547 Value *Ptr = Builder->CreateBitCast(II->getArgOperand(0), OpPtrTy);
548 return new StoreInst(II->getArgOperand(1), Ptr);
563 cast<VectorType>(II->getArgOperand(0)->getType())->getNumElements();
566 if (Value *V = SimplifyDemandedVectorElts(II->getArgOperand(0),
568 II->setArgOperand(0, V);
569 return II;
603 auto CDV = dyn_cast<ConstantDataVector>(II->getArgOperand(1));
604 auto CInt = dyn_cast<ConstantInt>(II->getArgOperand(1));
613 auto Vec = II->getArgOperand(0);
621 switch (II->getIntrinsicID()) {
656 cast<VectorType>(II->getArgOperand(0)->getType())->getNumElements();
660 if (Value *TmpV = SimplifyDemandedVectorElts(II->getArgOperand(0),
663 II->setArgOperand(0, TmpV);
664 return II;
673 if (auto CIWidth = dyn_cast<ConstantInt>(II->getArgOperand(2))) {
674 if (auto CIStart = dyn_cast<ConstantInt>(II->getArgOperand(3))) {
676 Value *Vec = II->getArgOperand(1);
683 II->getContext(), ArrayRef<uint32_t>(Mask))));
686 dyn_cast<IntrinsicInst>(II->getArgOperand(0))) {
688 Source->getArgOperand(1) == II->getArgOperand(1)) {
717 II->getArgOperand(2)->getType(), NewWidth, false);
719 II->getArgOperand(3)->getType(), NewStart, false);
721 II->getArgOperand(1), ConstantWidth,
746 Value *Mask = II->getArgOperand(2);
769 return SelectInst::Create(NewSelector, II->getArgOperand(1),
770 II->getArgOperand(0), "blendv");
781 Value *V = II->getArgOperand(1);
789 if (II->getIntrinsicID() == Intrinsic::x86_avx_vpermilvar_pd ||
790 II->getIntrinsicID() == Intrinsic::x86_avx_vpermilvar_pd_256)
803 if (II->getIntrinsicID() == Intrinsic::x86_avx_vpermilvar_ps_256 ||
804 II->getIntrinsicID() == Intrinsic::x86_avx_vpermilvar_pd_256) {
810 auto V1 = II->getArgOperand(0);
823 if (Constant *Mask = dyn_cast<Constant>(II->getArgOperand(2))) {
839 Value *Op0 = Builder->CreateBitCast(II->getArgOperand(0),
841 Value *Op1 = Builder->CreateBitCast(II->getArgOperand(1),
889 unsigned MemAlign = getKnownAlignment(II->getArgOperand(0), DL);
890 unsigned AlignArg = II->getNumArgOperands() - 1;
891 ConstantInt *IntrAlign = dyn_cast<ConstantInt>(II->getArgOperand(AlignArg));
893 II->setArgOperand(AlignArg,
894 ConstantInt::get(Type::getInt32Ty(II->getContext()),
896 return II;
905 Value *Arg0 = II->getArgOperand(0);
906 Value *Arg1 = II->getArgOperand(1);
910 return ReplaceInstUsesWith(CI, ConstantAggregateZero::get(II->getType()));
914 bool Zext = (II->getIntrinsicID() == Intrinsic::arm_neon_vmullu ||
915 II->getIntrinsicID() == Intrinsic::aarch64_neon_umull);
916 VectorType *NewVT = cast<VectorType>(II->getType());
934 return CastInst::CreateIntegerCast(Arg0, II->getType(),
941 if (const ConstantFP *C = dyn_cast<ConstantFP>(II->getArgOperand(0))) {
949 return ReplaceInstUsesWith(CI, ConstantFP::get(II->getContext(), Val));
957 if (IntrinsicInst *SS = dyn_cast<IntrinsicInst>(II->getArgOperand(0))) {
960 if (&*++BI == II)
967 BasicBlock::iterator BI = II;
968 TerminatorInst *TI = II->getParent()->getTerminator();
976 if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(BCI)) {
978 if (II->getIntrinsicID() == Intrinsic::stackrestore)
999 return visitCallSite(II);
1004 Instruction *InstCombiner::visitInvokeInst(InvokeInst &II) {
1005 return visitCallSite(&II);
1060 IntrinsicInst *II = dyn_cast<IntrinsicInst>(U);
1061 if (!II)
1063 if (II->getIntrinsicID() == Intrinsic::init_trampoline) {
1067 InitTrampoline = II;
1070 if (II->getIntrinsicID() == Intrinsic::adjust_trampoline)
1094 if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(I))
1095 if (II->getIntrinsicID() == Intrinsic::init_trampoline &&
1096 II->getOperand(0) == TrampMem)
1097 return II;
1186 if (IntrinsicInst *II = FindInitTrampoline(Callee))
1187 return transformCallThroughTrampoline(CS, II);
1273 if (InvokeInst *II = dyn_cast<InvokeInst>(Caller))
1274 for (User *U : II->users())
1276 if (PN->getParent() == II->getNormalDest() ||
1277 PN->getParent() == II->getUnwindDest())
1435 if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
1436 NC = Builder->CreateInvoke(Callee, II->getNormalDest(),
1437 II->getUnwindDest(), Args);
1438 NC->takeName(II);
1439 cast<InvokeInst>(NC)->setCallingConv(II->getCallingConv());
1460 if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
1461 BasicBlock::iterator I = II->getNormalDest()->getFirstInsertionPt();
1614 if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
1616 II->getNormalDest(), II->getUnwindDest(),
1618 cast<InvokeInst>(NewCaller)->setCallingConv(II->getCallingConv());