Lines Matching refs:IC
167 static Instruction *simplifyAllocaArraySize(InstCombiner &IC, AllocaInst &AI) { in simplifyAllocaArraySize() argument
175 Value *V = IC.Builder->getInt32(1); in simplifyAllocaArraySize()
183 AllocaInst *New = IC.Builder->CreateAlloca(NewTy, nullptr, AI.getName()); in simplifyAllocaArraySize()
196 Type *IdxTy = IC.getDataLayout().getIntPtrType(AI.getType()); in simplifyAllocaArraySize()
201 IC.InsertNewInstBefore(GEP, *It); in simplifyAllocaArraySize()
205 return IC.ReplaceInstUsesWith(AI, GEP); in simplifyAllocaArraySize()
209 return IC.ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType())); in simplifyAllocaArraySize()
213 Type *IntPtrTy = IC.getDataLayout().getIntPtrType(AI.getType()); in simplifyAllocaArraySize()
215 Value *V = IC.Builder->CreateIntCast(AI.getArraySize(), IntPtrTy, false); in simplifyAllocaArraySize()
317 static LoadInst *combineLoadToNewType(InstCombiner &IC, LoadInst &LI, Type *NewTy, in combineLoadToNewType() argument
324 LoadInst *NewLoad = IC.Builder->CreateAlignedLoad( in combineLoadToNewType()
325 IC.Builder->CreateBitCast(Ptr, NewTy->getPointerTo(AS)), in combineLoadToNewType()
384 static StoreInst *combineStoreToNewValue(InstCombiner &IC, StoreInst &SI, Value *V) { in combineStoreToNewValue() argument
390 StoreInst *NewStore = IC.Builder->CreateAlignedStore( in combineStoreToNewValue()
391 V, IC.Builder->CreateBitCast(Ptr, V->getType()->getPointerTo(AS)), in combineStoreToNewValue()
446 static Instruction *combineLoadToOperationType(InstCombiner &IC, LoadInst &LI) { in combineLoadToOperationType() argument
456 const DataLayout &DL = IC.getDataLayout(); in combineLoadToOperationType()
470 IC, LI, in combineLoadToOperationType()
475 IC.Builder->SetInsertPoint(SI); in combineLoadToOperationType()
476 combineStoreToNewValue(IC, *SI, NewLoad); in combineLoadToOperationType()
477 IC.EraseInstFromFunction(*SI); in combineLoadToOperationType()
492 LoadInst *NewLoad = combineLoadToNewType(IC, LI, CI->getDestTy()); in combineLoadToOperationType()
494 IC.EraseInstFromFunction(*CI); in combineLoadToOperationType()
504 static Instruction *unpackLoadToAggregate(InstCombiner &IC, LoadInst &LI) { in unpackLoadToAggregate() argument
519 LoadInst *NewLoad = combineLoadToNewType(IC, LI, ST->getTypeAtIndex(0U), in unpackLoadToAggregate()
521 return IC.ReplaceInstUsesWith(LI, IC.Builder->CreateInsertValue( in unpackLoadToAggregate()
529 LoadInst *NewLoad = combineLoadToNewType(IC, LI, AT->getElementType(), in unpackLoadToAggregate()
531 return IC.ReplaceInstUsesWith(LI, IC.Builder->CreateInsertValue( in unpackLoadToAggregate()
625 static bool canReplaceGEPIdxWithZero(InstCombiner &IC, GetElementPtrInst *GEPI, in canReplaceGEPIdxWithZero() argument
661 const DataLayout &DL = IC.getDataLayout(); in canReplaceGEPIdxWithZero()
671 IC.ComputeSignBit(GEPI->getOperand(i), KnownNonNegative, in canReplaceGEPIdxWithZero()
699 static Instruction *replaceGEPIdxWithZero(InstCombiner &IC, Value *Ptr, in replaceGEPIdxWithZero() argument
703 if (canReplaceGEPIdxWithZero(IC, GEPI, &MemI, Idx)) { in replaceGEPIdxWithZero()
862 static bool combineStoreToValueType(InstCombiner &IC, StoreInst &SI) { in combineStoreToValueType() argument
873 combineStoreToNewValue(IC, SI, V); in combineStoreToValueType()
882 static bool unpackStoreToAggregate(InstCombiner &IC, StoreInst &SI) { in unpackStoreToAggregate() argument
897 V = IC.Builder->CreateExtractValue(V, 0); in unpackStoreToAggregate()
898 combineStoreToNewValue(IC, SI, V); in unpackStoreToAggregate()
906 V = IC.Builder->CreateExtractValue(V, 0); in unpackStoreToAggregate()
907 combineStoreToNewValue(IC, SI, V); in unpackStoreToAggregate()