Lines Matching refs:Instruction
63 public InstVisitor<InstCombinerImpl, Instruction *> {
88 Instruction *visitFNeg(UnaryOperator &I);
89 Instruction *visitAdd(BinaryOperator &I);
90 Instruction *visitFAdd(BinaryOperator &I);
93 Instruction *visitSub(BinaryOperator &I);
94 Instruction *visitFSub(BinaryOperator &I);
95 Instruction *visitMul(BinaryOperator &I);
96 Instruction *visitFMul(BinaryOperator &I);
97 Instruction *visitURem(BinaryOperator &I);
98 Instruction *visitSRem(BinaryOperator &I);
99 Instruction *visitFRem(BinaryOperator &I);
101 Instruction *commonIRemTransforms(BinaryOperator &I);
102 Instruction *commonIDivTransforms(BinaryOperator &I);
103 Instruction *visitUDiv(BinaryOperator &I);
104 Instruction *visitSDiv(BinaryOperator &I);
105 Instruction *visitFDiv(BinaryOperator &I);
107 Instruction *visitAnd(BinaryOperator &I);
108 Instruction *visitOr(BinaryOperator &I);
110 Instruction *visitXor(BinaryOperator &I);
111 Instruction *visitShl(BinaryOperator &I);
115 Instruction *canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract(
117 Instruction *foldVariableSignZeroExtensionOfVariableHighBitExtract(
119 Instruction *visitAShr(BinaryOperator &I);
120 Instruction *visitLShr(BinaryOperator &I);
121 Instruction *commonShiftTransforms(BinaryOperator &I);
122 Instruction *visitFCmpInst(FCmpInst &I);
124 Instruction *visitICmpInst(ICmpInst &I);
125 Instruction *FoldShiftByConstant(Value *Op0, Constant *Op1,
127 Instruction *commonCastTransforms(CastInst &CI);
128 Instruction *commonPointerCastTransforms(CastInst &CI);
129 Instruction *visitTrunc(TruncInst &CI);
130 Instruction *visitZExt(ZExtInst &CI);
131 Instruction *visitSExt(SExtInst &CI);
132 Instruction *visitFPTrunc(FPTruncInst &CI);
133 Instruction *visitFPExt(CastInst &CI);
134 Instruction *visitFPToUI(FPToUIInst &FI);
135 Instruction *visitFPToSI(FPToSIInst &FI);
136 Instruction *visitUIToFP(CastInst &CI);
137 Instruction *visitSIToFP(CastInst &CI);
138 Instruction *visitPtrToInt(PtrToIntInst &CI);
139 Instruction *visitIntToPtr(IntToPtrInst &CI);
140 Instruction *visitBitCast(BitCastInst &CI);
141 Instruction *visitAddrSpaceCast(AddrSpaceCastInst &CI);
142 Instruction *foldItoFPtoI(CastInst &FI);
143 Instruction *visitSelectInst(SelectInst &SI);
144 Instruction *visitCallInst(CallInst &CI);
145 Instruction *visitInvokeInst(InvokeInst &II);
146 Instruction *visitCallBrInst(CallBrInst &CBI);
148 Instruction *SliceUpIllegalIntegerPHI(PHINode &PN);
149 Instruction *visitPHINode(PHINode &PN);
150 Instruction *visitGetElementPtrInst(GetElementPtrInst &GEP);
151 Instruction *visitGEPOfGEP(GetElementPtrInst &GEP, GEPOperator *Src);
152 Instruction *visitGEPOfBitcast(BitCastInst *BCI, GetElementPtrInst &GEP);
153 Instruction *visitAllocaInst(AllocaInst &AI);
154 Instruction *visitAllocSite(Instruction &FI);
155 Instruction *visitFree(CallInst &FI, Value *FreedOp);
156 Instruction *visitLoadInst(LoadInst &LI);
157 Instruction *visitStoreInst(StoreInst &SI);
158 Instruction *visitAtomicRMWInst(AtomicRMWInst &SI);
159 Instruction *visitUnconditionalBranchInst(BranchInst &BI);
160 Instruction *visitBranchInst(BranchInst &BI);
161 Instruction *visitFenceInst(FenceInst &FI);
162 Instruction *visitSwitchInst(SwitchInst &SI);
163 Instruction *visitReturnInst(ReturnInst &RI);
164 Instruction *visitUnreachableInst(UnreachableInst &I);
165 Instruction *
167 Instruction *visitInsertValueInst(InsertValueInst &IV);
168 Instruction *visitInsertElementInst(InsertElementInst &IE);
169 Instruction *visitExtractElementInst(ExtractElementInst &EI);
170 Instruction *visitShuffleVectorInst(ShuffleVectorInst &SVI);
171 Instruction *visitExtractValueInst(ExtractValueInst &EV);
172 Instruction *visitLandingPadInst(LandingPadInst &LI);
173 Instruction *visitVAEndInst(VAEndInst &I);
176 Instruction *foldFreezeIntoRecurrence(FreezeInst &I, PHINode *PN);
177 Instruction *visitFreeze(FreezeInst &I);
180 Instruction *visitInstruction(Instruction &I) { return nullptr; } in visitInstruction()
185 bool dominatesAllUses(const Instruction *DI, const Instruction *UI,
225 bool OptimizeOverflowCheck(Instruction::BinaryOps BinaryOp, bool IsSigned,
227 Instruction &CtxI, Value *&OperationResult,
230 Instruction *visitCallBase(CallBase &Call);
231 Instruction *tryOptimizeCall(CallInst *CI);
233 Instruction *transformCallThroughTrampoline(CallBase &Call,
237 Instruction *simplifyMaskedStore(IntrinsicInst &II);
238 Instruction *simplifyMaskedGather(IntrinsicInst &II);
239 Instruction *simplifyMaskedScatter(IntrinsicInst &II);
250 Instruction *transformZExtICmp(ICmpInst *ICI, ZExtInst &CI);
252 Instruction *transformSExtICmp(ICmpInst *ICI, Instruction &CI);
255 const Instruction &CxtI) const { in willNotOverflowSignedAdd()
261 const Instruction &CxtI) const { in willNotOverflowUnsignedAdd()
267 const Instruction &CxtI, bool IsSigned) const { in willNotOverflowAdd()
273 const Instruction &CxtI) const { in willNotOverflowSignedSub()
279 const Instruction &CxtI) const { in willNotOverflowUnsignedSub()
285 const Instruction &CxtI, bool IsSigned) const { in willNotOverflowSub()
291 const Instruction &CxtI) const { in willNotOverflowSignedMul()
297 const Instruction &CxtI) const { in willNotOverflowUnsignedMul()
303 const Instruction &CxtI, bool IsSigned) const { in willNotOverflowMul()
309 const Value *RHS, const Instruction &CxtI, in willNotOverflow()
312 case Instruction::Add: return willNotOverflowAdd(LHS, RHS, CxtI, IsSigned); in willNotOverflow()
313 case Instruction::Sub: return willNotOverflowSub(LHS, RHS, CxtI, IsSigned); in willNotOverflow()
314 case Instruction::Mul: return willNotOverflowMul(LHS, RHS, CxtI, IsSigned); in willNotOverflow()
320 Instruction *scalarizePHI(ExtractElementInst &EI, PHINode *PN);
321 Instruction *foldBitcastExtElt(ExtractElementInst &ExtElt);
322 Instruction *foldCastedBitwiseLogic(BinaryOperator &I);
323 Instruction *foldBinopOfSextBoolToSelect(BinaryOperator &I);
324 Instruction *narrowBinOp(TruncInst &Trunc);
325 Instruction *narrowMaskedBinOp(BinaryOperator &And);
326 Instruction *narrowMathIfNoOverflow(BinaryOperator &I);
327 Instruction *narrowFunnelShift(TruncInst &Trunc);
328 Instruction *optimizeBitCastFromPhi(CastInst &CI, PHINode *PN);
329 Instruction *matchSAddSubSat(IntrinsicInst &MinMax1);
330 Instruction *foldNot(BinaryOperator &I);
344 Instruction::CastOps isEliminableCastPair(const CastInst *CI1,
348 Value *foldAndOrOfICmps(ICmpInst *LHS, ICmpInst *RHS, Instruction &I,
364 Instruction *CxtI, bool IsAnd,
369 Instruction *foldIntrinsicWithOverflowCommon(IntrinsicInst *II);
370 Instruction *foldFPSignBitOps(BinaryOperator &I);
376 Instruction *foldAndOrOfSelectUsingImpliedCond(Value *Op, SelectInst &SI,
384 Instruction *InsertNewInstBefore(Instruction *New, Instruction &Old) { in InsertNewInstBefore()
394 Instruction *InsertNewInstWith(Instruction *New, Instruction &Old) { in InsertNewInstWith()
405 Instruction *replaceInstUsesWith(Instruction &I, Value *V) { in replaceInstUsesWith()
426 Instruction *replaceOperand(Instruction &I, unsigned OpNum, Value *V) { in replaceOperand()
440 void CreateNonTerminatorUnreachable(Instruction *InsertAt) { in CreateNonTerminatorUnreachable()
453 Instruction *eraseInstFromFunction(Instruction &I) override { in eraseInstFromFunction()
461 if (auto *Inst = dyn_cast<Instruction>(Operand)) in eraseInstFromFunction()
471 unsigned Depth, const Instruction *CxtI) const { in computeKnownBits()
476 const Instruction *CxtI) const { in computeKnownBits()
482 const Instruction *CxtI = nullptr) {
487 const Instruction *CxtI = nullptr) const {
492 const Instruction *CxtI = nullptr) const {
498 const Instruction *CxtI) const { in computeOverflowForUnsignedMul()
504 const Instruction *CxtI) const { in computeOverflowForSignedMul()
510 const Instruction *CxtI) const { in computeOverflowForUnsignedAdd()
516 const Instruction *CxtI) const { in computeOverflowForSignedAdd()
522 const Instruction *CxtI) const { in computeOverflowForUnsignedSub()
527 const Instruction *CxtI) const { in computeOverflowForSignedSub()
532 Instruction::BinaryOps BinaryOp, bool IsSigned,
533 Value *LHS, Value *RHS, Instruction *CxtI) const;
562 Value *tryFactorization(BinaryOperator &, Instruction::BinaryOps, Value *,
577 unsigned Depth, Instruction *CxtI);
578 bool SimplifyDemandedBits(Instruction *I, unsigned Op,
585 Value *SimplifyMultipleUseDemandedBits(Instruction *I,
588 unsigned Depth, Instruction *CxtI);
593 Instruction *Shr, const APInt &ShrOp1, Instruction *Shl,
598 bool SimplifyDemandedInstructionBits(Instruction &Inst);
605 Instruction *foldVectorBinop(BinaryOperator &Inst);
606 Instruction *foldVectorSelect(SelectInst &Sel);
607 Instruction *foldSelectShuffle(ShuffleVectorInst &Shuf);
612 Instruction *foldOpIntoPhi(Instruction &I, PHINode *PN);
622 Instruction *foldBinopWithPhiOperands(BinaryOperator &BO);
628 Instruction *FoldOpIntoSelect(Instruction &Op, SelectInst *SI,
632 Instruction *foldBinOpIntoSelectOrPhi(BinaryOperator &I);
634 Instruction *foldAddWithConstant(BinaryOperator &Add);
638 Instruction *foldPHIArgOpIntoPHI(PHINode &PN);
639 Instruction *foldPHIArgBinOpIntoPHI(PHINode &PN);
640 Instruction *foldPHIArgInsertValueInstructionIntoPHI(PHINode &PN);
641 Instruction *foldPHIArgExtractValueInstructionIntoPHI(PHINode &PN);
642 Instruction *foldPHIArgGEPIntoPHI(PHINode &PN);
643 Instruction *foldPHIArgLoadIntoPHI(PHINode &PN);
644 Instruction *foldPHIArgZextsIntoPHI(PHINode &PN);
645 Instruction *foldPHIArgIntToPtrToPHI(PHINode &PN);
650 Instruction *foldIntegerTypedPHI(PHINode &PN);
654 void PHIArgMergedDebugLoc(Instruction *Inst, PHINode &PN);
656 Instruction *foldGEPICmp(GEPOperator *GEPLHS, Value *RHS,
657 ICmpInst::Predicate Cond, Instruction &I);
658 Instruction *foldSelectICmp(ICmpInst::Predicate Pred, SelectInst *SI,
660 Instruction *foldAllocaCmp(ICmpInst &ICI, const AllocaInst *Alloca);
661 Instruction *foldCmpLoadFromIndexedGlobal(LoadInst *LI,
665 Instruction *foldFCmpIntToFPConst(FCmpInst &I, Instruction *LHSI,
667 Instruction *foldICmpAddOpConst(Value *X, const APInt &C,
669 Instruction *foldICmpWithCastOp(ICmpInst &ICmp);
670 Instruction *foldICmpWithZextOrSext(ICmpInst &ICmp);
672 Instruction *foldICmpUsingKnownBits(ICmpInst &Cmp);
673 Instruction *foldICmpWithDominatingICmp(ICmpInst &Cmp);
674 Instruction *foldICmpWithConstant(ICmpInst &Cmp);
675 Instruction *foldICmpInstWithConstant(ICmpInst &Cmp);
676 Instruction *foldICmpInstWithConstantNotInt(ICmpInst &Cmp);
677 Instruction *foldICmpInstWithConstantAllowUndef(ICmpInst &Cmp,
679 Instruction *foldICmpBinOp(ICmpInst &Cmp, const SimplifyQuery &SQ);
680 Instruction *foldICmpEquality(ICmpInst &Cmp);
681 Instruction *foldIRemByPowerOfTwoToBitTest(ICmpInst &I);
682 Instruction *foldSignBitTest(ICmpInst &I);
683 Instruction *foldICmpWithZero(ICmpInst &Cmp);
687 Instruction *foldICmpBinOpWithConstant(ICmpInst &Cmp, BinaryOperator *BO,
689 Instruction *foldICmpSelectConstant(ICmpInst &Cmp, SelectInst *Select,
691 Instruction *foldICmpTruncConstant(ICmpInst &Cmp, TruncInst *Trunc,
693 Instruction *foldICmpAndConstant(ICmpInst &Cmp, BinaryOperator *And,
695 Instruction *foldICmpXorConstant(ICmpInst &Cmp, BinaryOperator *Xor,
697 Instruction *foldICmpOrConstant(ICmpInst &Cmp, BinaryOperator *Or,
699 Instruction *foldICmpMulConstant(ICmpInst &Cmp, BinaryOperator *Mul,
701 Instruction *foldICmpShlConstant(ICmpInst &Cmp, BinaryOperator *Shl,
703 Instruction *foldICmpShrConstant(ICmpInst &Cmp, BinaryOperator *Shr,
705 Instruction *foldICmpSRemConstant(ICmpInst &Cmp, BinaryOperator *UDiv,
707 Instruction *foldICmpUDivConstant(ICmpInst &Cmp, BinaryOperator *UDiv,
709 Instruction *foldICmpDivConstant(ICmpInst &Cmp, BinaryOperator *Div,
711 Instruction *foldICmpSubConstant(ICmpInst &Cmp, BinaryOperator *Sub,
713 Instruction *foldICmpAddConstant(ICmpInst &Cmp, BinaryOperator *Add,
715 Instruction *foldICmpAndConstConst(ICmpInst &Cmp, BinaryOperator *And,
717 Instruction *foldICmpAndShift(ICmpInst &Cmp, BinaryOperator *And,
719 Instruction *foldICmpShrConstConst(ICmpInst &I, Value *ShAmt, const APInt &C1,
721 Instruction *foldICmpShlConstConst(ICmpInst &I, Value *ShAmt, const APInt &C1,
724 Instruction *foldICmpBinOpEqualityWithConstant(ICmpInst &Cmp,
727 Instruction *foldICmpIntrinsicWithConstant(ICmpInst &ICI, IntrinsicInst *II,
729 Instruction *foldICmpEqIntrinsicWithConstant(ICmpInst &ICI, IntrinsicInst *II,
731 Instruction *foldICmpBitCast(ICmpInst &Cmp);
734 Instruction *foldSelectExtConst(SelectInst &Sel);
735 Instruction *foldSelectOpOp(SelectInst &SI, Instruction *TI, Instruction *FI);
736 Instruction *foldSelectIntoOp(SelectInst &SI, Value *, Value *);
737 Instruction *foldSPFofSPF(Instruction *Inner, SelectPatternFlavor SPF1,
738 Value *A, Value *B, Instruction &Outer,
740 Instruction *foldSelectInstWithICmp(SelectInst &SI, ICmpInst *ICI);
741 Instruction *foldSelectValueEquivalence(SelectInst &SI, ICmpInst &ICI);
745 Instruction *PromoteCastOfAllocation(BitCastInst &CI, AllocaInst &AI);
751 Instruction *matchBSwapOrBitReverse(Instruction &I, bool MatchBSwaps,
754 Instruction *SimplifyAnyMemTransfer(AnyMemTransferInst *MI);
755 Instruction *SimplifyAnyMemSet(AnyMemSetInst *MI);
767 SmallVector<Instruction *, NegatorMaxNodesSSO> NewInstructions;
788 using Result = std::pair<ArrayRef<Instruction *> /*NewInstructions*/,
791 std::array<Value *, 2> getSortedOperandsOfBinOp(Instruction *I);