Lines Matching defs:IRB

1603 static void speculatePHINodeLoads(IRBuilderTy &IRB, PHINode &PN) {
1608 IRB.SetInsertPoint(&PN);
1609 PHINode *NewPN = IRB.CreatePHI(LoadTy, PN.getNumIncomingValues(),
1640 IRB.SetInsertPoint(TI);
1642 LoadInst *Load = IRB.CreateAlignedLoad(
1747 IRBuilderTy &IRB) {
1756 IRB.SetInsertPoint(&LI);
1759 IRB.CreateAlignedLoad(LI.getType(), TV, LI.getAlign(),
1762 IRB.CreateAlignedLoad(LI.getType(), FV, LI.getAlign(),
1776 Value *V = IRB.CreateSelect(SI.getCondition(), TL, FL,
1853 IRBuilderTy &IRB, DomTreeUpdater *DTU) {
1868 speculateSelectInstLoads(SI, cast<LoadInst>(*I), IRB);
1885 static Value *getAdjustedPtr(IRBuilderTy &IRB, const DataLayout &DL, Value *Ptr,
1889 Ptr = IRB.CreateInBoundsPtrAdd(Ptr, IRB.getInt(Offset),
1891 return IRB.CreatePointerBitCastOrAddrSpaceCast(Ptr, PointerTy,
1968 static Value *convertValue(const DataLayout &DL, IRBuilderTy &IRB, Value *V,
1985 return IRB.CreateIntToPtr(IRB.CreateBitCast(V, DL.getIntPtrType(NewTy)),
1995 return IRB.CreateBitCast(IRB.CreatePtrToInt(V, DL.getIntPtrType(OldTy)),
2010 return IRB.CreateIntToPtr(IRB.CreatePtrToInt(V, DL.getIntPtrType(OldTy)),
2015 return IRB.CreateBitCast(V, NewTy);
2470 static Value *extractInteger(const DataLayout &DL, IRBuilderTy &IRB, Value *V,
2483 V = IRB.CreateLShr(V, ShAmt, Name + ".shift");
2489 V = IRB.CreateTrunc(V, Ty, Name + ".trunc");
2495 static Value *insertInteger(const DataLayout &DL, IRBuilderTy &IRB, Value *Old,
2503 V = IRB.CreateZExt(V, IntTy, Name + ".ext");
2514 V = IRB.CreateShl(V, ShAmt, Name + ".shift");
2520 Old = IRB.CreateAnd(Old, Mask, Name + ".mask");
2522 V = IRB.CreateOr(Old, V, Name + ".insert");
2528 static Value *extractVector(IRBuilderTy &IRB, Value *V, unsigned BeginIndex,
2538 V = IRB.CreateExtractElement(V, IRB.getInt32(BeginIndex),
2545 V = IRB.CreateShuffleVector(V, Mask, Name + ".extract");
2550 static Value *insertVector(IRBuilderTy &IRB, Value *Old, Value *V,
2558 V = IRB.CreateInsertElement(Old, V, IRB.getInt32(BeginIndex),
2585 V = IRB.CreateShuffleVector(V, Mask, Name + ".expand");
2591 Mask2.push_back(IRB.getInt1(i >= BeginIndex && i < EndIndex));
2593 V = IRB.CreateSelect(ConstantVector::get(Mask2), V, Old, Name + "blend");
2660 IRBuilderTy IRB;
2668 Type *AccessTy = IRB.getPtrTy(AddrSpace);
2669 return IRB.CreateAddrSpaceCast(&NewAI, AccessTy);
2695 IRB(NewAI.getContext(), ConstantFolder()) {
2732 IRB.SetInsertPoint(OldUserI);
2733 IRB.SetCurrentDebugLocation(OldUserI->getDebugLoc());
2734 IRB.getInserter().SetNamePrefix(Twine(NewAI.getName()) + "." +
2753 Value *getNewAllocaSlicePtr(IRBuilderTy &IRB, Type *PointerTy) {
2780 return getAdjustedPtr(IRB, DL, &NewAI,
2821 LoadInst *Load = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
2826 return extractVector(IRB, Load, BeginIndex, EndIndex, "vec");
2832 Value *V = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
2834 V = convertValue(DL, IRB, V, IntTy);
2839 V = extractInteger(DL, IRB, V, ExtractTy, Offset, "extract");
2849 V = IRB.CreateZExt(V, LI.getType());
2879 LoadInst *NewLI = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), NewPtr,
2906 V = IRB.CreateZExt(V, TITy, "load.ext");
2908 V = IRB.CreateShl(V, TITy->getBitWidth() - AITy->getBitWidth(),
2912 Type *LTy = IRB.getPtrTy(AS);
2914 IRB.CreateAlignedLoad(TargetTy, getNewAllocaSlicePtr(IRB, LTy),
2929 V = convertValue(DL, IRB, V, TargetTy);
2945 IRB.SetInsertPoint(LI.getParent(), LIIt);
2951 new LoadInst(LI.getType(), PoisonValue::get(IRB.getPtrTy(AS)), "",
2953 V = insertInteger(DL, IRB, Placeholder, V, NewBeginOffset - BeginOffset,
2984 V = convertValue(DL, IRB, V, SliceTy);
2987 Value *Old = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
2989 V = insertVector(IRB, Old, V, BeginIndex, "vec");
2991 StoreInst *Store = IRB.CreateAlignedStore(V, &NewAI, NewAI.getAlign());
3011 Value *Old = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3013 Old = convertValue(DL, IRB, Old, IntTy);
3016 V = insertInteger(DL, IRB, Old, SI.getValueOperand(), Offset, "insert");
3018 V = convertValue(DL, IRB, V, NewAllocaTy);
3019 StoreInst *Store = IRB.CreateAlignedStore(V, &NewAI, NewAI.getAlign());
3056 V = extractInteger(DL, IRB, V, NarrowTy, NewBeginOffset - BeginOffset,
3069 V = convertValue(DL, IRB, V, NewAllocaTy);
3074 IRB.CreateAlignedStore(V, NewPtr, NewAI.getAlign(), SI.isVolatile());
3077 Value *NewPtr = getNewAllocaSlicePtr(IRB, IRB.getPtrTy(AS));
3079 IRB.CreateAlignedStore(V, NewPtr, getSliceAlign(), SI.isVolatile());
3121 V = IRB.CreateMul(
3122 IRB.CreateZExt(V, SplatIntTy, "zext"),
3123 IRB.CreateUDiv(Constant::getAllOnesValue(SplatIntTy),
3124 IRB.CreateZExt(Constant::getAllOnesValue(V->getType()),
3132 V = IRB.CreateVectorSplat(NumElements, V, "vsplat");
3148 II.setDest(getNewAllocaSlicePtr(IRB, OldPtr->getType()));
3188 MemIntrinsic *New = cast<MemIntrinsic>(IRB.CreateMemSet(
3189 getNewAllocaSlicePtr(IRB, OldPtr->getType()), II.getValue(), Size,
3222 Splat = convertValue(DL, IRB, Splat, ElementTy);
3226 Value *Old = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3228 V = insertVector(IRB, Old, Splat, BeginIndex, "vec");
3239 Value *Old = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3241 Old = convertValue(DL, IRB, Old, IntTy);
3243 V = insertInteger(DL, IRB, Old, V, Offset, "insert");
3248 V = convertValue(DL, IRB, V, AllocaTy);
3260 V = convertValue(DL, IRB, V, AllocaTy);
3265 IRB.CreateAlignedStore(V, NewPtr, NewAI.getAlign(), II.isVolatile());
3300 Value *AdjustedPtr = getNewAllocaSlicePtr(IRB, OldPtr->getType());
3377 OtherPtr = getAdjustedPtr(IRB, DL, OtherPtr, OtherOffset, OtherPtrTy,
3380 Value *OurPtr = getNewAllocaSlicePtr(IRB, OldPtr->getType());
3398 CallInst *New = IRB.CreateMemCpy(DestPtr, DestAlign, SrcPtr, SrcAlign,
3440 Value *AdjPtr = getAdjustedPtr(IRB, DL, OtherPtr, OtherOffset, OtherPtrTy,
3460 Src = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3462 Src = extractVector(IRB, Src, BeginIndex, EndIndex, "vec");
3464 Src = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3466 Src = convertValue(DL, IRB, Src, IntTy);
3468 Src = extractInteger(DL, IRB, Src, SubIntTy, Offset, "extract");
3470 LoadInst *Load = IRB.CreateAlignedLoad(OtherTy, SrcPtr, SrcAlign,
3481 Value *Old = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3483 Src = insertVector(IRB, Old, Src, BeginIndex, "vec");
3485 Value *Old = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3487 Old = convertValue(DL, IRB, Old, IntTy);
3489 Src = insertInteger(DL, IRB, Old, Src, Offset, "insert");
3490 Src = convertValue(DL, IRB, Src, NewAllocaTy);
3494 IRB.CreateAlignedStore(Src, DstPtr, DstAlign, II.isVolatile()));
3553 Type *PointerTy = IRB.getPtrTy(OldPtr->getType()->getPointerAddressSpace());
3554 Value *Ptr = getNewAllocaSlicePtr(IRB, PointerTy);
3557 New = IRB.CreateLifetimeStart(Ptr, Size);
3559 New = IRB.CreateLifetimeEnd(Ptr, Size);
3605 IRBuilderBase::InsertPointGuard Guard(IRB);
3607 IRB.SetInsertPoint(OldPtr->getParent(),
3610 IRB.SetInsertPoint(OldPtr);
3611 IRB.SetCurrentDebugLocation(OldPtr->getDebugLoc());
3613 Value *NewPtr = getNewAllocaSlicePtr(IRB, OldPtr->getType());
3637 Value *NewPtr = getNewAllocaSlicePtr(IRB, OldPtr->getType());
3680 IRBuilderTy &IRB;
3683 AggLoadStoreRewriter(const DataLayout &DL, IRBuilderTy &IRB)
3684 : DL(DL), IRB(IRB) {}
3715 IRBuilderTy &IRB;
3742 Align BaseAlign, const DataLayout &DL, IRBuilderTy &IRB)
3743 : IRB(IRB), GEPIndices(1, IRB.getInt32(0)), Ptr(Ptr), BaseTy(BaseTy),
3745 IRB.SetInsertPoint(InsertionPoint);
3776 GEPIndices.push_back(IRB.getInt32(Idx));
3791 GEPIndices.push_back(IRB.getInt32(Idx));
3808 IRBuilderTy &IRB)
3810 IRB),
3819 IRB.CreateInBoundsGEP(BaseTy, Ptr, GEPIndices, Name + ".gep");
3821 IRB.CreateAlignedLoad(Ty, GEP, Alignment, Name + ".load");
3830 Agg = IRB.CreateInsertValue(Agg, Load, Indices, Name + ".insert");
3843 getAdjustedAlignment(&LI, 0), DL, IRB);
3855 const DataLayout &DL, IRBuilderTy &IRB)
3857 DL, IRB),
3870 IRB.CreateExtractValue(Agg, Indices, Name + ".extract");
3872 IRB.CreateInBoundsGEP(BaseTy, Ptr, GEPIndices, Name + ".gep");
3874 IRB.CreateAlignedStore(ExtractValue, InBoundsGEP, Alignment);
3916 getAdjustedAlignment(&SI, 0), DL, IRB);
3982 IRB.SetInsertPoint(&GEPI);
3986 Value *NTrue = IRB.CreateGEP(Ty, TrueOps[0], ArrayRef(TrueOps).drop_front(),
3990 IRB.CreateGEP(Ty, FalseOps[0], ArrayRef(FalseOps).drop_front(),
3993 Value *NSel = IRB.CreateSelect(Sel->getCondition(), NTrue, NFalse,
4067 IRB.SetInsertPoint(Phi);
4068 PHINode *NewPhi = IRB.CreatePHI(GEPI.getType(), Phi->getNumIncomingValues(),
4074 IRB.SetInsertPoint(GEPI.getFunction()->getEntryBlock().getTerminator());
4084 IRB.CreateGEP(SourceTy, NewOps[0], ArrayRef(NewOps).drop_front(),
4483 IRBuilderTy IRB(&AI);
4518 IRB.SetInsertPoint(LI);
4528 LoadInst *PLoad = IRB.CreateAlignedLoad(
4530 getAdjustedPtr(IRB, DL, BasePtr,
4575 IRB.SetInsertPoint(SI);
4586 StoreInst *PStore = IRB.CreateAlignedStore(
4588 getAdjustedPtr(IRB, DL, StoreBasePtr,
4675 IRB.SetInsertPoint(LI);
4677 PLoad = IRB.CreateAlignedLoad(
4679 getAdjustedPtr(IRB, DL, LoadBasePtr,
4689 IRB.SetInsertPoint(SI);
4691 StoreInst *PStore = IRB.CreateAlignedStore(
4693 getAdjustedPtr(IRB, DL, StoreBasePtr,
5453 IRBuilderTy IRB(&AI);
5454 AggLoadStoreRewriter AggRewriter(DL, IRB);
5489 speculatePHINodeLoads(IRB, *SpeculatablePHIs.pop_back_val());
5496 rewriteSelectInstMemOps(*K, V, IRB, PreserveCFG ? nullptr : DTU);