Lines Matching defs:IRB

1625 static void speculatePHINodeLoads(IRBuilderTy &IRB, PHINode &PN) {
1630 IRB.SetInsertPoint(&PN);
1631 PHINode *NewPN = IRB.CreatePHI(LoadTy, PN.getNumIncomingValues(),
1662 IRB.SetInsertPoint(TI);
1664 LoadInst *Load = IRB.CreateAlignedLoad(
1769 IRBuilderTy &IRB) {
1778 IRB.SetInsertPoint(&LI);
1781 IRB.CreateAlignedLoad(LI.getType(), TV, LI.getAlign(),
1784 IRB.CreateAlignedLoad(LI.getType(), FV, LI.getAlign(),
1798 Value *V = IRB.CreateSelect(SI.getCondition(), TL, FL,
1875 IRBuilderTy &IRB, DomTreeUpdater *DTU) {
1890 speculateSelectInstLoads(SI, cast<LoadInst>(*I), IRB);
1907 static Value *getAdjustedPtr(IRBuilderTy &IRB, const DataLayout &DL, Value *Ptr,
1911 Ptr = IRB.CreateInBoundsPtrAdd(Ptr, IRB.getInt(Offset),
1913 return IRB.CreatePointerBitCastOrAddrSpaceCast(Ptr, PointerTy,
1990 static Value *convertValue(const DataLayout &DL, IRBuilderTy &IRB, Value *V,
2007 return IRB.CreateIntToPtr(IRB.CreateBitCast(V, DL.getIntPtrType(NewTy)),
2017 return IRB.CreateBitCast(IRB.CreatePtrToInt(V, DL.getIntPtrType(OldTy)),
2032 return IRB.CreateIntToPtr(IRB.CreatePtrToInt(V, DL.getIntPtrType(OldTy)),
2037 return IRB.CreateBitCast(V, NewTy);
2492 static Value *extractInteger(const DataLayout &DL, IRBuilderTy &IRB, Value *V,
2505 V = IRB.CreateLShr(V, ShAmt, Name + ".shift");
2511 V = IRB.CreateTrunc(V, Ty, Name + ".trunc");
2517 static Value *insertInteger(const DataLayout &DL, IRBuilderTy &IRB, Value *Old,
2525 V = IRB.CreateZExt(V, IntTy, Name + ".ext");
2536 V = IRB.CreateShl(V, ShAmt, Name + ".shift");
2542 Old = IRB.CreateAnd(Old, Mask, Name + ".mask");
2544 V = IRB.CreateOr(Old, V, Name + ".insert");
2550 static Value *extractVector(IRBuilderTy &IRB, Value *V, unsigned BeginIndex,
2560 V = IRB.CreateExtractElement(V, IRB.getInt32(BeginIndex),
2567 V = IRB.CreateShuffleVector(V, Mask, Name + ".extract");
2572 static Value *insertVector(IRBuilderTy &IRB, Value *Old, Value *V,
2580 V = IRB.CreateInsertElement(Old, V, IRB.getInt32(BeginIndex),
2607 V = IRB.CreateShuffleVector(V, Mask, Name + ".expand");
2613 Mask2.push_back(IRB.getInt1(i >= BeginIndex && i < EndIndex));
2615 V = IRB.CreateSelect(ConstantVector::get(Mask2), V, Old, Name + "blend");
2682 IRBuilderTy IRB;
2690 Type *AccessTy = IRB.getPtrTy(AddrSpace);
2691 return IRB.CreateAddrSpaceCast(&NewAI, AccessTy);
2717 IRB(NewAI.getContext(), ConstantFolder()) {
2754 IRB.SetInsertPoint(OldUserI);
2755 IRB.SetCurrentDebugLocation(OldUserI->getDebugLoc());
2756 IRB.getInserter().SetNamePrefix(Twine(NewAI.getName()) + "." +
2775 Value *getNewAllocaSlicePtr(IRBuilderTy &IRB, Type *PointerTy) {
2802 return getAdjustedPtr(IRB, DL, &NewAI,
2843 LoadInst *Load = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
2848 return extractVector(IRB, Load, BeginIndex, EndIndex, "vec");
2854 Value *V = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
2856 V = convertValue(DL, IRB, V, IntTy);
2861 V = extractInteger(DL, IRB, V, ExtractTy, Offset, "extract");
2871 V = IRB.CreateZExt(V, LI.getType());
2901 LoadInst *NewLI = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), NewPtr,
2928 V = IRB.CreateZExt(V, TITy, "load.ext");
2930 V = IRB.CreateShl(V, TITy->getBitWidth() - AITy->getBitWidth(),
2934 Type *LTy = IRB.getPtrTy(AS);
2936 IRB.CreateAlignedLoad(TargetTy, getNewAllocaSlicePtr(IRB, LTy),
2951 V = convertValue(DL, IRB, V, TargetTy);
2967 IRB.SetInsertPoint(LI.getParent(), LIIt);
2973 new LoadInst(LI.getType(), PoisonValue::get(IRB.getPtrTy(AS)), "",
2975 V = insertInteger(DL, IRB, Placeholder, V, NewBeginOffset - BeginOffset,
3006 V = convertValue(DL, IRB, V, SliceTy);
3009 Value *Old = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3011 V = insertVector(IRB, Old, V, BeginIndex, "vec");
3013 StoreInst *Store = IRB.CreateAlignedStore(V, &NewAI, NewAI.getAlign());
3033 Value *Old = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3035 Old = convertValue(DL, IRB, Old, IntTy);
3038 V = insertInteger(DL, IRB, Old, SI.getValueOperand(), Offset, "insert");
3040 V = convertValue(DL, IRB, V, NewAllocaTy);
3041 StoreInst *Store = IRB.CreateAlignedStore(V, &NewAI, NewAI.getAlign());
3078 V = extractInteger(DL, IRB, V, NarrowTy, NewBeginOffset - BeginOffset,
3091 V = convertValue(DL, IRB, V, NewAllocaTy);
3096 IRB.CreateAlignedStore(V, NewPtr, NewAI.getAlign(), SI.isVolatile());
3099 Value *NewPtr = getNewAllocaSlicePtr(IRB, IRB.getPtrTy(AS));
3101 IRB.CreateAlignedStore(V, NewPtr, getSliceAlign(), SI.isVolatile());
3143 V = IRB.CreateMul(
3144 IRB.CreateZExt(V, SplatIntTy, "zext"),
3145 IRB.CreateUDiv(Constant::getAllOnesValue(SplatIntTy),
3146 IRB.CreateZExt(Constant::getAllOnesValue(V->getType()),
3154 V = IRB.CreateVectorSplat(NumElements, V, "vsplat");
3170 II.setDest(getNewAllocaSlicePtr(IRB, OldPtr->getType()));
3210 MemIntrinsic *New = cast<MemIntrinsic>(IRB.CreateMemSet(
3211 getNewAllocaSlicePtr(IRB, OldPtr->getType()), II.getValue(), Size,
3244 Splat = convertValue(DL, IRB, Splat, ElementTy);
3248 Value *Old = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3250 V = insertVector(IRB, Old, Splat, BeginIndex, "vec");
3261 Value *Old = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3263 Old = convertValue(DL, IRB, Old, IntTy);
3265 V = insertInteger(DL, IRB, Old, V, Offset, "insert");
3270 V = convertValue(DL, IRB, V, AllocaTy);
3282 V = convertValue(DL, IRB, V, AllocaTy);
3287 IRB.CreateAlignedStore(V, NewPtr, NewAI.getAlign(), II.isVolatile());
3322 Value *AdjustedPtr = getNewAllocaSlicePtr(IRB, OldPtr->getType());
3399 OtherPtr = getAdjustedPtr(IRB, DL, OtherPtr, OtherOffset, OtherPtrTy,
3402 Value *OurPtr = getNewAllocaSlicePtr(IRB, OldPtr->getType());
3420 CallInst *New = IRB.CreateMemCpy(DestPtr, DestAlign, SrcPtr, SrcAlign,
3462 Value *AdjPtr = getAdjustedPtr(IRB, DL, OtherPtr, OtherOffset, OtherPtrTy,
3482 Src = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3484 Src = extractVector(IRB, Src, BeginIndex, EndIndex, "vec");
3486 Src = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3488 Src = convertValue(DL, IRB, Src, IntTy);
3490 Src = extractInteger(DL, IRB, Src, SubIntTy, Offset, "extract");
3492 LoadInst *Load = IRB.CreateAlignedLoad(OtherTy, SrcPtr, SrcAlign,
3503 Value *Old = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3505 Src = insertVector(IRB, Old, Src, BeginIndex, "vec");
3507 Value *Old = IRB.CreateAlignedLoad(NewAI.getAllocatedType(), &NewAI,
3509 Old = convertValue(DL, IRB, Old, IntTy);
3511 Src = insertInteger(DL, IRB, Old, Src, Offset, "insert");
3512 Src = convertValue(DL, IRB, Src, NewAllocaTy);
3516 IRB.CreateAlignedStore(Src, DstPtr, DstAlign, II.isVolatile()));
3575 Type *PointerTy = IRB.getPtrTy(OldPtr->getType()->getPointerAddressSpace());
3576 Value *Ptr = getNewAllocaSlicePtr(IRB, PointerTy);
3579 New = IRB.CreateLifetimeStart(Ptr, Size);
3581 New = IRB.CreateLifetimeEnd(Ptr, Size);
3627 IRBuilderBase::InsertPointGuard Guard(IRB);
3629 IRB.SetInsertPoint(OldPtr->getParent(),
3632 IRB.SetInsertPoint(OldPtr);
3633 IRB.SetCurrentDebugLocation(OldPtr->getDebugLoc());
3635 Value *NewPtr = getNewAllocaSlicePtr(IRB, OldPtr->getType());
3659 Value *NewPtr = getNewAllocaSlicePtr(IRB, OldPtr->getType());
3702 IRBuilderTy &IRB;
3705 AggLoadStoreRewriter(const DataLayout &DL, IRBuilderTy &IRB)
3706 : DL(DL), IRB(IRB) {}
3737 IRBuilderTy &IRB;
3764 Align BaseAlign, const DataLayout &DL, IRBuilderTy &IRB)
3765 : IRB(IRB), GEPIndices(1, IRB.getInt32(0)), Ptr(Ptr), BaseTy(BaseTy),
3767 IRB.SetInsertPoint(InsertionPoint);
3798 GEPIndices.push_back(IRB.getInt32(Idx));
3813 GEPIndices.push_back(IRB.getInt32(Idx));
3836 IRBuilderTy &IRB)
3838 IRB),
3847 IRB.CreateInBoundsGEP(BaseTy, Ptr, GEPIndices, Name + ".gep");
3849 IRB.CreateAlignedLoad(Ty, GEP, Alignment, Name + ".load");
3861 Agg = IRB.CreateInsertValue(Agg, Load, Indices, Name + ".insert");
3877 IRB.SetInsertPoint(I);
3879 IRB.CreateIntrinsic(Intrinsic::fake_use, {}, {V});
3893 getAdjustedAlignment(&LI, 0), DL, IRB);
3907 const DataLayout &DL, IRBuilderTy &IRB)
3909 DL, IRB),
3922 IRB.CreateExtractValue(Agg, Indices, Name + ".extract");
3924 IRB.CreateInBoundsGEP(BaseTy, Ptr, GEPIndices, Name + ".gep");
3926 IRB.CreateAlignedStore(ExtractValue, InBoundsGEP, Alignment);
3968 getAdjustedAlignment(&SI, 0), DL, IRB);
4034 IRB.SetInsertPoint(&GEPI);
4038 Value *NTrue = IRB.CreateGEP(Ty, TrueOps[0], ArrayRef(TrueOps).drop_front(),
4042 IRB.CreateGEP(Ty, FalseOps[0], ArrayRef(FalseOps).drop_front(),
4045 Value *NSel = IRB.CreateSelect(Sel->getCondition(), NTrue, NFalse,
4119 IRB.SetInsertPoint(Phi);
4120 PHINode *NewPhi = IRB.CreatePHI(GEPI.getType(), Phi->getNumIncomingValues(),
4126 IRB.SetInsertPoint(GEPI.getFunction()->getEntryBlock().getTerminator());
4136 IRB.CreateGEP(SourceTy, NewOps[0], ArrayRef(NewOps).drop_front(),
4535 IRBuilderTy IRB(&AI);
4570 IRB.SetInsertPoint(LI);
4580 LoadInst *PLoad = IRB.CreateAlignedLoad(
4582 getAdjustedPtr(IRB, DL, BasePtr,
4627 IRB.SetInsertPoint(SI);
4638 StoreInst *PStore = IRB.CreateAlignedStore(
4640 getAdjustedPtr(IRB, DL, StoreBasePtr,
4727 IRB.SetInsertPoint(LI);
4729 PLoad = IRB.CreateAlignedLoad(
4731 getAdjustedPtr(IRB, DL, LoadBasePtr,
4741 IRB.SetInsertPoint(SI);
4743 StoreInst *PStore = IRB.CreateAlignedStore(
4745 getAdjustedPtr(IRB, DL, StoreBasePtr,
5591 IRBuilderTy IRB(&AI);
5592 AggLoadStoreRewriter AggRewriter(DL, IRB);
5632 speculatePHINodeLoads(IRB, *SpeculatablePHIs.pop_back_val());
5639 rewriteSelectInstMemOps(*K, V, IRB, PreserveCFG ? nullptr : DTU);