Home | History | Annotate | Download | only in InstCombine

Lines Matching full:instruction

43   if (isa<Instruction>(V)) {
64 void InsertHelper(Instruction *I, const Twine &Name,
74 public InstVisitor<InstCombiner, Instruction*> {
106 // Visitation implementation - Implement instruction combining for different
107 // instruction types. The semantics are as follows:
111 // otherwise - Change was made, replace I with returned instruction
113 Instruction *visitAdd(BinaryOperator &I);
114 Instruction *visitFAdd(BinaryOperator &I);
116 Instruction *visitSub(BinaryOperator &I);
117 Instruction *visitFSub(BinaryOperator &I);
118 Instruction *visitMul(BinaryOperator &I);
119 Value *foldFMulConst(Instruction *FMulOrDiv, ConstantFP *C,
120 Instruction *InsertBefore);
121 Instruction *visitFMul(BinaryOperator &I);
122 Instruction *visitURem(BinaryOperator &I);
123 Instruction *visitSRem(BinaryOperator &I);
124 Instruction *visitFRem(BinaryOperator &I);
126 Instruction *commonRemTransforms(BinaryOperator &I);
127 Instruction *commonIRemTransforms(BinaryOperator &I);
128 Instruction *commonDivTransforms(BinaryOperator &I);
129 Instruction *commonIDivTransforms(BinaryOperator &I);
130 Instruction *visitUDiv(BinaryOperator &I);
131 Instruction *visitSDiv(BinaryOperator &I);
132 Instruction *visitFDiv(BinaryOperator &I);
135 Instruction *visitAnd(BinaryOperator &I);
138 Instruction *FoldOrWithConstants(BinaryOperator &I, Value *Op,
140 Instruction *visitOr (BinaryOperator &I);
141 Instruction *visitXor(BinaryOperator &I);
142 Instruction *visitShl(BinaryOperator &I);
143 Instruction *visitAShr(BinaryOperator &I);
144 Instruction *visitLShr(BinaryOperator &I);
145 Instruction *commonShiftTransforms(BinaryOperator &I);
146 Instruction *FoldFCmp_IntToFP_Cst(FCmpInst &I, Instruction *LHSI,
148 Instruction *FoldCmpLoadFromIndexedGlobal(GetElementPtrInst *GEP,
151 Instruction *visitFCmpInst(FCmpInst &I);
152 Instruction *visitICmpInst(ICmpInst &I);
153 Instruction *visitICmpInstWithCastAndCast(ICmpInst &ICI);
154 Instruction *visitICmpInstWithInstAndIntCst(ICmpInst &ICI,
155 Instruction *LHS,
157 Instruction *FoldICmpDivCst(ICmpInst &ICI, BinaryOperator *DivI,
159 Instruction *FoldICmpShrCst(ICmpInst &ICI, BinaryOperator *DivI,
161 Instruction *FoldICmpAddOpCst(ICmpInst &ICI, Value *X, ConstantInt *CI,
163 Instruction *FoldGEPICmp(GEPOperator *GEPLHS, Value *RHS,
164 ICmpInst::Predicate Cond, Instruction &I);
165 Instruction *FoldShiftByConstant(Value *Op0, ConstantInt *Op1,
167 Instruction *commonCastTransforms(CastInst &CI);
168 Instruction *commonPointerCastTransforms(CastInst &CI);
169 Instruction *visitTrunc(TruncInst &CI);
170 Instruction *visitZExt(ZExtInst &CI);
171 Instruction *visitSExt(SExtInst &CI);
172 Instruction *visitFPTrunc(FPTruncInst &CI);
173 Instruction *visitFPExt(CastInst &CI);
174 Instruction *visitFPToUI(FPToUIInst &FI);
175 Instruction *visitFPToSI(FPToSIInst &FI);
176 Instruction *visitUIToFP(CastInst &CI);
177 Instruction *visitSIToFP(CastInst &CI);
178 Instruction *visitPtrToInt(PtrToIntInst &CI);
179 Instruction *visitIntToPtr(IntToPtrInst &CI);
180 Instruction *visitBitCast(BitCastInst &CI);
181 Instruction *FoldSelectOpOp(SelectInst &SI, Instruction *TI,
182 Instruction *FI);
183 Instruction *FoldSelectIntoOp(SelectInst &SI, Value*, Value*);
184 Instruction *FoldSPFofSPF(Instruction *Inner, SelectPatternFlavor SPF1,
185 Value *A, Value *B, Instruction &Outer,
187 Instruction *visitSelectInst(SelectInst &SI);
188 Instruction *visitSelectInstWithICmp(SelectInst &SI, ICmpInst *ICI);
189 Instruction *visitCallInst(CallInst &CI);
190 Instruction *visitInvokeInst(InvokeInst &II);
192 Instruction *SliceUpIllegalIntegerPHI(PHINode &PN);
193 Instruction *visitPHINode(PHINode &PN);
194 Instruction *visitGetElementPtrInst(GetElementPtrInst &GEP);
195 Instruction *visitAllocaInst(AllocaInst &AI);
196 Instruction *visitAllocSite(Instruction &FI);
197 Instruction *visitFree(CallInst &FI);
198 Instruction *visitLoadInst(LoadInst &LI);
199 Instruction *visitStoreInst(StoreInst &SI);
200 Instruction *visitBranchInst(BranchInst &BI);
201 Instruction *visitSwitchInst(SwitchInst &SI);
202 Instruction *visitInsertElementInst(InsertElementInst &IE);
203 Instruction *visitExtractElementInst(ExtractElementInst &EI);
204 Instruction *visitShuffleVectorInst(ShuffleVectorInst &SVI);
205 Instruction *visitExtractValueInst(ExtractValueInst &EV);
206 Instruction *visitLandingPadInst(LandingPadInst &LI);
209 Instruction *visitInstruction(Instruction &I) { return 0; }
217 Instruction *FoldOpIntoSelect(Instruction &Op, SelectInst *SI);
223 bool ShouldOptimizeCast(Instruction::CastOps opcode,const Value *V,
226 Instruction *visitCallSite(CallSite CS);
227 Instruction *tryOptimizeCall(CallInst *CI, const DataLayout *TD);
229 Instruction *transformCallThroughTrampoline(CallSite CS,
231 Instruction *transformZExtICmp(ICmpInst *ICI, Instruction &CI,
233 Instruction *transformSExtICmp(ICmpInst *ICI, Instruction &CI);
236 Instruction *scalarizePHI(ExtractElementInst &EI, PHINode *PN);
240 // InsertNewInstBefore - insert an instruction New before instruction Old
241 // in the program. Add the new instruction to the worklist.
243 Instruction *InsertNewInstBefore(Instruction *New, Instruction &Old) {
245 "New instruction already inserted into a basic block!");
255 Instruction *InsertNewInstWith(Instruction *New, Instruction &Old) {
260 // ReplaceInstUsesWith - This method is to be used when an instruction is
266 Instruction *ReplaceInstUsesWith(Instruction &I, Value *V) {
269 // If we are replacing the instruction with itself, this must be in a
270 // segment of unreachable code, so just clobber the instruction.
281 // EraseInstFromFunction - When dealing with an instruction that has side
283 // instruction. Instead, visit methods should return the value returned by
285 Instruction *EraseInstFromFunction(Instruction &I) {
288 assert(I.use_empty() && "Cannot erase instruction that is used!");
293 if (Instruction *Op = dyn_cast<Instruction>(*i))
337 /// bit for "r1 = shr x, c1; r2 = shl r1, c2" instruction sequence.
338 Value *SimplifyShrShlDemandedBits(Instruction *Lsr, Instruction *Sftl,
342 /// SimplifyDemandedInstructionBits - Inst is an integer instruction that
343 /// SimplifyDemandedBits knows about. See if the instruction has any
345 bool SimplifyDemandedInstructionBits(Instruction &Inst);
350 // FoldOpIntoPhi - Given a binary operator, cast instruction, or select
351 // which has a PHI node as operand #0, see if we can fold the instruction
355 Instruction *FoldOpIntoPhi(Instruction &I);
360 Instruction *FoldPHIArgOpIntoPHI(PHINode &PN);
361 Instruction *FoldPHIArgBinOpIntoPHI(PHINode &PN);
362 Instruction *FoldPHIArgGEPIntoPHI(PHINode &PN);
363 Instruction *FoldPHIArgLoadIntoPHI(PHINode &PN);
366 Instruction *OptAndOp(Instruction *Op, ConstantInt *OpRHS,
370 bool isSub, Instruction &I);
373 Instruction *PromoteCastOfAllocation(BitCastInst &CI, AllocaInst &AI);
374 Instruction *MatchBSwap(BinaryOperator &I);
376 Instruction *SimplifyMemTransfer(MemIntrinsic *MI);
377 Instruction