Lines Matching refs:II
200 static Value *SimplifyX86insertps(const IntrinsicInst &II, in SimplifyX86insertps() argument
202 if (auto *CInt = dyn_cast<ConstantInt>(II.getArgOperand(2))) { in SimplifyX86insertps()
203 VectorType *VecTy = cast<VectorType>(II.getType()); in SimplifyX86insertps()
233 return Builder.CreateShuffleVector(II.getArgOperand(0), II.getArgOperand(1), in SimplifyX86insertps()
242 static Value *SimplifyX86vperm2(const IntrinsicInst &II, in SimplifyX86vperm2() argument
244 if (auto *CInt = dyn_cast<ConstantInt>(II.getArgOperand(2))) { in SimplifyX86vperm2()
245 VectorType *VecTy = cast<VectorType>(II.getType()); in SimplifyX86vperm2()
281 Value *V0 = LowInputSelect ? II.getArgOperand(1) : II.getArgOperand(0); in SimplifyX86vperm2()
282 Value *V1 = HighInputSelect ? II.getArgOperand(1) : II.getArgOperand(0); in SimplifyX86vperm2()
320 IntrinsicInst *II = dyn_cast<IntrinsicInst>(&CI); in visitCallInst() local
321 if (!II) return visitCallSite(&CI); in visitCallInst()
325 if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(II)) { in visitCallInst()
377 if (Changed) return II; in visitCallInst()
380 switch (II->getIntrinsicID()) { in visitCallInst()
384 if (getObjectSize(II->getArgOperand(0), Size, DL, TLI)) in visitCallInst()
389 Value *IIOperand = II->getArgOperand(0); in visitCallInst()
408 if (ConstantInt *Power = dyn_cast<ConstantInt>(II->getArgOperand(1))) { in visitCallInst()
414 return ReplaceInstUsesWith(CI, II->getArgOperand(0)); in visitCallInst()
418 II->getArgOperand(0)); in visitCallInst()
424 IntegerType *IT = dyn_cast<IntegerType>(II->getArgOperand(0)->getType()); in visitCallInst()
430 computeKnownBits(II->getArgOperand(0), KnownZero, KnownOne, 0, II); in visitCallInst()
442 IntegerType *IT = dyn_cast<IntegerType>(II->getArgOperand(0)->getType()); in visitCallInst()
448 computeKnownBits(II->getArgOperand(0), KnownZero, KnownOne, 0, II); in visitCallInst()
462 if (isa<Constant>(II->getArgOperand(0)) && in visitCallInst()
463 !isa<Constant>(II->getArgOperand(1))) { in visitCallInst()
465 Value *LHS = II->getArgOperand(0); in visitCallInst()
466 II->setArgOperand(0, II->getArgOperand(1)); in visitCallInst()
467 II->setArgOperand(1, LHS); in visitCallInst()
468 return II; in visitCallInst()
475 IntrinsicIDToOverflowCheckFlavor(II->getIntrinsicID()); in visitCallInst()
480 if (OptimizeOverflowCheck(OCF, II->getArgOperand(0), II->getArgOperand(1), in visitCallInst()
481 *II, OperationResult, OverflowResult)) in visitCallInst()
482 return CreateOverflowTuple(II, OperationResult, OverflowResult); in visitCallInst()
489 Value *Arg0 = II->getArgOperand(0); in visitCallInst()
490 Value *Arg1 = II->getArgOperand(1); in visitCallInst()
501 II->setArgOperand(0, Arg1); in visitCallInst()
502 II->setArgOperand(1, Arg0); in visitCallInst()
503 return II; in visitCallInst()
523 if (II->getIntrinsicID() == Intrinsic::minnum) { in visitCallInst()
546 assert(II->getIntrinsicID() == Intrinsic::maxnum); in visitCallInst()
574 if (getOrEnforceKnownAlignment(II->getArgOperand(0), 16, DL, II, AC, DT) >= in visitCallInst()
576 Value *Ptr = Builder->CreateBitCast(II->getArgOperand(0), in visitCallInst()
577 PointerType::getUnqual(II->getType())); in visitCallInst()
584 Value *Ptr = Builder->CreateBitCast(II->getArgOperand(0), in visitCallInst()
585 PointerType::getUnqual(II->getType())); in visitCallInst()
591 if (getOrEnforceKnownAlignment(II->getArgOperand(1), 16, DL, II, AC, DT) >= in visitCallInst()
594 PointerType::getUnqual(II->getArgOperand(0)->getType()); in visitCallInst()
595 Value *Ptr = Builder->CreateBitCast(II->getArgOperand(1), OpPtrTy); in visitCallInst()
596 return new StoreInst(II->getArgOperand(0), Ptr); in visitCallInst()
602 Type *OpPtrTy = PointerType::getUnqual(II->getArgOperand(0)->getType()); in visitCallInst()
603 Value *Ptr = Builder->CreateBitCast(II->getArgOperand(1), OpPtrTy); in visitCallInst()
604 return new StoreInst(II->getArgOperand(0), Ptr, false, 1); in visitCallInst()
608 if (getOrEnforceKnownAlignment(II->getArgOperand(0), 16, DL, II, AC, DT) >= in visitCallInst()
610 Value *Ptr = Builder->CreateBitCast(II->getArgOperand(0), in visitCallInst()
611 PointerType::getUnqual(II->getType())); in visitCallInst()
617 if (getOrEnforceKnownAlignment(II->getArgOperand(0), 32, DL, II, AC, DT) >= in visitCallInst()
619 Value *Ptr = Builder->CreateBitCast(II->getArgOperand(0), in visitCallInst()
620 PointerType::getUnqual(II->getType())); in visitCallInst()
626 if (getOrEnforceKnownAlignment(II->getArgOperand(1), 16, DL, II, AC, DT) >= in visitCallInst()
629 PointerType::getUnqual(II->getArgOperand(0)->getType()); in visitCallInst()
630 Value *Ptr = Builder->CreateBitCast(II->getArgOperand(1), OpPtrTy); in visitCallInst()
631 return new StoreInst(II->getArgOperand(0), Ptr); in visitCallInst()
636 if (getOrEnforceKnownAlignment(II->getArgOperand(1), 32, DL, II, AC, DT) >= in visitCallInst()
639 PointerType::getUnqual(II->getArgOperand(0)->getType()); in visitCallInst()
640 Value *Ptr = Builder->CreateBitCast(II->getArgOperand(1), OpPtrTy); in visitCallInst()
641 return new StoreInst(II->getArgOperand(0), Ptr); in visitCallInst()
648 if (getOrEnforceKnownAlignment(II->getArgOperand(0), 16, DL, II, AC, DT) >= in visitCallInst()
651 PointerType::getUnqual(II->getArgOperand(1)->getType()); in visitCallInst()
652 Value *Ptr = Builder->CreateBitCast(II->getArgOperand(0), OpPtrTy); in visitCallInst()
653 return new StoreInst(II->getArgOperand(1), Ptr); in visitCallInst()
668 cast<VectorType>(II->getArgOperand(0)->getType())->getNumElements(); in visitCallInst()
671 if (Value *V = SimplifyDemandedVectorElts(II->getArgOperand(0), in visitCallInst()
673 II->setArgOperand(0, V); in visitCallInst()
674 return II; in visitCallInst()
708 auto CDV = dyn_cast<ConstantDataVector>(II->getArgOperand(1)); in visitCallInst()
709 auto CInt = dyn_cast<ConstantInt>(II->getArgOperand(1)); in visitCallInst()
718 auto Vec = II->getArgOperand(0); in visitCallInst()
726 switch (II->getIntrinsicID()) { in visitCallInst()
761 cast<VectorType>(II->getArgOperand(0)->getType())->getNumElements(); in visitCallInst()
766 II->getArgOperand(0), InputDemandedElts, UndefElts)) { in visitCallInst()
767 II->setArgOperand(0, TmpV); in visitCallInst()
768 return II; in visitCallInst()
773 if (Value *V = SimplifyX86insertps(*II, *Builder)) in visitCallInst()
774 return ReplaceInstUsesWith(*II, V); in visitCallInst()
781 if (auto CIWidth = dyn_cast<ConstantInt>(II->getArgOperand(2))) { in visitCallInst()
782 if (auto CIStart = dyn_cast<ConstantInt>(II->getArgOperand(3))) { in visitCallInst()
796 return ReplaceInstUsesWith(CI, UndefValue::get(II->getType())); in visitCallInst()
799 Value *Vec = II->getArgOperand(1); in visitCallInst()
806 II->getContext(), makeArrayRef(Mask)))); in visitCallInst()
809 dyn_cast<IntrinsicInst>(II->getArgOperand(0))) { in visitCallInst()
811 Source->getArgOperand(1) == II->getArgOperand(1)) { in visitCallInst()
840 II->getArgOperand(2)->getType(), NewWidth, false); in visitCallInst()
842 II->getArgOperand(3)->getType(), NewStart, false); in visitCallInst()
844 II->getArgOperand(1), ConstantWidth, in visitCallInst()
869 Value *Mask = II->getArgOperand(2); in visitCallInst()
892 return SelectInst::Create(NewSelector, II->getArgOperand(1), in visitCallInst()
893 II->getArgOperand(0), "blendv"); in visitCallInst()
904 Value *V = II->getArgOperand(1); in visitCallInst()
912 if (II->getIntrinsicID() == Intrinsic::x86_avx_vpermilvar_pd || in visitCallInst()
913 II->getIntrinsicID() == Intrinsic::x86_avx_vpermilvar_pd_256) in visitCallInst()
926 if (II->getIntrinsicID() == Intrinsic::x86_avx_vpermilvar_ps_256 || in visitCallInst()
927 II->getIntrinsicID() == Intrinsic::x86_avx_vpermilvar_pd_256) { in visitCallInst()
933 auto V1 = II->getArgOperand(0); in visitCallInst()
943 if (Value *V = SimplifyX86vperm2(*II, *Builder)) in visitCallInst()
944 return ReplaceInstUsesWith(*II, V); in visitCallInst()
954 if (Constant *Mask = dyn_cast<Constant>(II->getArgOperand(2))) { in visitCallInst()
970 Value *Op0 = Builder->CreateBitCast(II->getArgOperand(0), in visitCallInst()
972 Value *Op1 = Builder->CreateBitCast(II->getArgOperand(1), in visitCallInst()
1020 unsigned MemAlign = getKnownAlignment(II->getArgOperand(0), DL, II, AC, DT); in visitCallInst()
1021 unsigned AlignArg = II->getNumArgOperands() - 1; in visitCallInst()
1022 ConstantInt *IntrAlign = dyn_cast<ConstantInt>(II->getArgOperand(AlignArg)); in visitCallInst()
1024 II->setArgOperand(AlignArg, in visitCallInst()
1025 ConstantInt::get(Type::getInt32Ty(II->getContext()), in visitCallInst()
1027 return II; in visitCallInst()
1036 Value *Arg0 = II->getArgOperand(0); in visitCallInst()
1037 Value *Arg1 = II->getArgOperand(1); in visitCallInst()
1041 return ReplaceInstUsesWith(CI, ConstantAggregateZero::get(II->getType())); in visitCallInst()
1045 bool Zext = (II->getIntrinsicID() == Intrinsic::arm_neon_vmullu || in visitCallInst()
1046 II->getIntrinsicID() == Intrinsic::aarch64_neon_umull); in visitCallInst()
1047 VectorType *NewVT = cast<VectorType>(II->getType()); in visitCallInst()
1065 return CastInst::CreateIntegerCast(Arg0, II->getType(), in visitCallInst()
1072 if (const ConstantFP *C = dyn_cast<ConstantFP>(II->getArgOperand(0))) { in visitCallInst()
1080 return ReplaceInstUsesWith(CI, ConstantFP::get(II->getContext(), Val)); in visitCallInst()
1088 if (IntrinsicInst *SS = dyn_cast<IntrinsicInst>(II->getArgOperand(0))) { in visitCallInst()
1091 if (&*++BI == II) in visitCallInst()
1098 BasicBlock::iterator BI = II; in visitCallInst()
1099 TerminatorInst *TI = II->getParent()->getTerminator(); in visitCallInst()
1107 if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(BCI)) { in visitCallInst() local
1109 if (II->getIntrinsicID() == Intrinsic::stackrestore) in visitCallInst()
1132 Value *IIOperand = II->getArgOperand(0), *A, *B, in visitCallInst()
1133 *AssumeIntrinsic = II->getCalledValue(); in visitCallInst()
1135 Builder->CreateCall(AssumeIntrinsic, A, II->getName()); in visitCallInst()
1136 Builder->CreateCall(AssumeIntrinsic, B, II->getName()); in visitCallInst()
1137 return EraseInstFromFunction(*II); in visitCallInst()
1142 II->getName()); in visitCallInst()
1144 II->getName()); in visitCallInst()
1145 return EraseInstFromFunction(*II); in visitCallInst()
1159 if (isValidAssumeForContext(II, LI, DT)) { in visitCallInst()
1160 MDNode *MD = MDNode::get(II->getContext(), None); in visitCallInst()
1162 return EraseInstFromFunction(*II); in visitCallInst()
1171 computeKnownBits(IIOperand, KnownZero, KnownOne, 0, II); in visitCallInst()
1173 return EraseInstFromFunction(*II); in visitCallInst()
1181 GCRelocateOperands Operands(II); in visitCallInst()
1186 if (II->use_empty()) in visitCallInst()
1187 return EraseInstFromFunction(*II); in visitCallInst()
1194 return ReplaceInstUsesWith(*II, DerivedPtr); in visitCallInst()
1200 return ReplaceInstUsesWith(*II, DerivedPtr); in visitCallInst()
1204 II->addAttribute(AttributeSet::ReturnIndex, Attribute::NonNull); in visitCallInst()
1210 II->addDereferenceableAttr(AttributeSet::ReturnIndex, Bytes); in visitCallInst()
1221 return visitCallSite(II); in visitCallInst()
1226 Instruction *InstCombiner::visitInvokeInst(InvokeInst &II) { in visitInvokeInst() argument
1227 return visitCallSite(&II); in visitInvokeInst()
1294 IntrinsicInst *II = dyn_cast<IntrinsicInst>(U); in FindInitTrampolineFromAlloca() local
1295 if (!II) in FindInitTrampolineFromAlloca()
1297 if (II->getIntrinsicID() == Intrinsic::init_trampoline) { in FindInitTrampolineFromAlloca()
1301 InitTrampoline = II; in FindInitTrampolineFromAlloca()
1304 if (II->getIntrinsicID() == Intrinsic::adjust_trampoline) in FindInitTrampolineFromAlloca()
1328 if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(I)) in FindInitTrampolineFromBB() local
1329 if (II->getIntrinsicID() == Intrinsic::init_trampoline && in FindInitTrampolineFromBB()
1330 II->getOperand(0) == TrampMem) in FindInitTrampolineFromBB()
1331 return II; in FindInitTrampolineFromBB()
1420 if (IntrinsicInst *II = FindInitTrampoline(Callee)) in visitCallSite() local
1421 return transformCallThroughTrampoline(CS, II); in visitCallSite()
1511 if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) in transformConstExprCastCall() local
1512 for (User *U : II->users()) in transformConstExprCastCall()
1514 if (PN->getParent() == II->getNormalDest() || in transformConstExprCastCall()
1515 PN->getParent() == II->getUnwindDest()) in transformConstExprCastCall()
1685 if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) { in transformConstExprCastCall() local
1686 NC = Builder->CreateInvoke(Callee, II->getNormalDest(), in transformConstExprCastCall()
1687 II->getUnwindDest(), Args); in transformConstExprCastCall()
1688 NC->takeName(II); in transformConstExprCastCall()
1689 cast<InvokeInst>(NC)->setCallingConv(II->getCallingConv()); in transformConstExprCastCall()
1710 if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) { in transformConstExprCastCall() local
1711 BasicBlock::iterator I = II->getNormalDest()->getFirstInsertionPt(); in transformConstExprCastCall()
1870 if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) { in transformCallThroughTrampoline() local
1872 II->getNormalDest(), II->getUnwindDest(), in transformCallThroughTrampoline()
1874 cast<InvokeInst>(NewCaller)->setCallingConv(II->getCallingConv()); in transformCallThroughTrampoline()