Lines Matching refs:IRB

1153   IRBuilderTy IRB(&SI);
1161 IRB.SetInsertPoint(LI);
1163 IRB.CreateLoad(TV, LI->getName() + ".sroa.speculate.load.true");
1165 IRB.CreateLoad(FV, LI->getName() + ".sroa.speculate.load.false");
1176 Value *V = IRB.CreateSelect(SI.getCondition(), TL, FL,
1190 static Value *buildGEP(IRBuilderTy &IRB, Value *BasePtr,
1200 return IRB.CreateInBoundsGEP(BasePtr, Indices, "idx");
1212 static Value *getNaturalGEPWithType(IRBuilderTy &IRB, const DataLayout &DL,
1216 return buildGEP(IRB, BasePtr, Indices);
1229 Indices.push_back(IRB.getInt(APInt(DL.getPointerSizeInBits(0), 0)));
1234 Indices.push_back(IRB.getInt32(0));
1243 return buildGEP(IRB, BasePtr, Indices);
1250 static Value *getNaturalGEPRecursively(IRBuilderTy &IRB, const DataLayout &DL,
1255 return getNaturalGEPWithType(IRB, DL, Ptr, Ty, TargetTy, Indices);
1273 Indices.push_back(IRB.getInt(NumSkippedElements));
1274 return getNaturalGEPRecursively(IRB, DL, Ptr, VecTy->getElementType(),
1286 Indices.push_back(IRB.getInt(NumSkippedElements));
1287 return getNaturalGEPRecursively(IRB, DL, Ptr, ElementTy, Offset, TargetTy,
1305 Indices.push_back(IRB.getInt32(Index));
1306 return getNaturalGEPRecursively(IRB, DL, Ptr, ElementTy, Offset, TargetTy,
1320 static Value *getNaturalGEPWithOffset(IRBuilderTy &IRB, const DataLayout &DL,
1327 if (Ty == IRB.getInt8PtrTy() && TargetTy->isIntegerTy(8))
1339 Indices.push_back(IRB.getInt(NumSkippedElements));
1340 return getNaturalGEPRecursively(IRB, DL, Ptr, ElementTy, Offset, TargetTy,
1359 static Value *getAdjustedPtr(IRBuilderTy &IRB, const DataLayout &DL,
1393 if (Value *P = getNaturalGEPWithOffset(IRB, DL, Ptr, Offset, TargetTy,
1428 Int8Ptr = IRB.CreateBitCast(Ptr, IRB.getInt8PtrTy(),
1434 IRB.CreateInBoundsGEP(Int8Ptr, IRB.getInt(Int8PtrOffset),
1441 Ptr = IRB.CreateBitCast(Ptr, PointerTy, "cast");
1485 static Value *convertValue(const DataLayout &DL, IRBuilderTy &IRB, Value *V,
1496 return IRB.CreateZExt(V, NewITy);
1504 return IRB.CreateIntToPtr(IRB.CreateBitCast(V, DL.getIntPtrType(NewTy)),
1509 return IRB.CreateIntToPtr(IRB.CreateBitCast(V, DL.getIntPtrType(NewTy)),
1512 return IRB.CreateIntToPtr(V, NewTy);
1521 return IRB.CreateBitCast(IRB.CreatePtrToInt(V, DL.getIntPtrType(OldTy)),
1526 return IRB.CreateBitCast(IRB.CreatePtrToInt(V, DL.getIntPtrType(OldTy)),
1529 return IRB.CreatePtrToInt(V, NewTy);
1532 return IRB.CreateBitCast(V, NewTy);
1766 static Value *extractInteger(const DataLayout &DL, IRBuilderTy &IRB, Value *V,
1777 V = IRB.CreateLShr(V, ShAmt, Name + ".shift");
1783 V = IRB.CreateTrunc(V, Ty, Name + ".trunc");
1789 static Value *insertInteger(const DataLayout &DL, IRBuilderTy &IRB, Value *Old,
1797 V = IRB.CreateZExt(V, IntTy, Name + ".ext");
1806 V = IRB.CreateShl(V, ShAmt, Name + ".shift");
1812 Old = IRB.CreateAnd(Old, Mask, Name + ".mask");
1814 V = IRB.CreateOr(Old, V, Name + ".insert");
1820 static Value *extractVector(IRBuilderTy &IRB, Value *V,
1831 V = IRB.CreateExtractElement(V, IRB.getInt32(BeginIndex),
1840 Mask.push_back(IRB.getInt32(i));
1841 V = IRB.CreateShuffleVector(V, UndefValue::get(V->getType()),
1848 static Value *insertVector(IRBuilderTy &IRB, Value *Old, Value *V,
1856 V = IRB.CreateInsertElement(Old, V, IRB.getInt32(BeginIndex),
1878 Mask.push_back(IRB.getInt32(i - BeginIndex));
1880 Mask.push_back(UndefValue::get(IRB.getInt32Ty()));
1881 V = IRB.CreateShuffleVector(V, UndefValue::get(V->getType()),
1888 Mask.push_back(IRB.getInt1(i >= BeginIndex && i < EndIndex));
1890 V = IRB.CreateSelect(ConstantVector::get(Mask), V, Old, Name + "blend");
1947 IRBuilderTy IRB;
1968 IRB(NewAI.getContext(), ConstantFolder()) {
1990 IRB.SetInsertPoint(OldUserI);
1991 IRB.SetCurrentDebugLocation(OldUserI->getDebugLoc());
1992 IRB.SetNamePrefix(Twine(NewAI.getName()) + "." + Twine(BeginOffset) + ".");
2024 Value *getAdjustedAllocaPtr(IRBuilderTy &IRB, uint64_t Offset,
2027 return getAdjustedPtr(IRB, DL, &NewAI, APInt(DL.getPointerSizeInBits(),
2071 Value *V = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
2073 return extractVector(IRB, V, BeginIndex, EndIndex, "vec");
2080 Value *V = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
2082 V = convertValue(DL, IRB, V, IntTy);
2086 V = extractInteger(DL, IRB, V, cast<IntegerType>(LI.getType()), Offset,
2114 V = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
2118 V = IRB.CreateAlignedLoad(
2119 getAdjustedAllocaPtr(IRB, NewBeginOffset, LTy),
2124 V = convertValue(DL, IRB, V, TargetTy);
2136 IRB.SetInsertPoint(llvm::next(BasicBlock::iterator(&LI)));
2143 V = insertInteger(DL, IRB, Placeholder, V, NewBeginOffset,
2171 V = convertValue(DL, IRB, V, SliceTy);
2174 Value *Old = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
2176 V = insertVector(IRB, Old, V, BeginIndex, "vec");
2178 StoreInst *Store = IRB.CreateAlignedStore(V, &NewAI, NewAI.getAlignment());
2191 Value *Old = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
2193 Old = convertValue(DL, IRB, Old, IntTy);
2196 V = insertInteger(DL, IRB, Old, SI.getValueOperand(), Offset,
2199 V = convertValue(DL, IRB, V, NewAllocaTy);
2200 StoreInst *Store = IRB.CreateAlignedStore(V, &NewAI, NewAI.getAlignment());
2235 V = extractInteger(DL, IRB, V, NarrowTy, NewBeginOffset,
2249 V = convertValue(DL, IRB, V, NewAllocaTy);
2250 NewSI = IRB.CreateAlignedStore(V, &NewAI, NewAI.getAlignment(),
2253 Value *NewPtr = getAdjustedAllocaPtr(IRB, NewBeginOffset,
2255 NewSI = IRB.CreateAlignedStore(
2285 V = IRB.CreateMul(IRB.CreateZExt(V, SplatIntTy, "zext"),
2297 V = IRB.CreateVectorSplat(NumElements, V, "vsplat");
2312 getAdjustedAllocaPtr(IRB, BeginOffset, II.getRawDest()->getType()));
2343 CallInst *New = IRB.CreateMemSet(
2344 getAdjustedAllocaPtr(IRB, NewBeginOffset, II.getRawDest()->getType()),
2370 Splat = convertValue(DL, IRB, Splat, ElementTy);
2374 Value *Old = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
2376 V = insertVector(IRB, Old, Splat, BeginIndex, "vec");
2387 Value *Old = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
2389 Old = convertValue(DL, IRB, Old, IntTy);
2391 V = insertInteger(DL, IRB, Old, V, Offset, "insert");
2396 V = convertValue(DL, IRB, V, AllocaTy);
2406 V = convertValue(DL, IRB, V, AllocaTy);
2409 Value *New = IRB.CreateAlignedStore(V, &NewAI, NewAI.getAlignment(),
2453 getAdjustedAllocaPtr(IRB, BeginOffset, II.getRawDest()->getType()));
2455 II.setSource(getAdjustedAllocaPtr(IRB, BeginOffset,
2507 OtherPtr = getAdjustedPtr(IRB, DL, OtherPtr, RelOffset, OtherPtrTy);
2510 IRB, NewBeginOffset,
2515 CallInst *New = IRB.CreateMemCpy(IsDest ? OurPtr : OtherPtr,
2550 Value *SrcPtr = getAdjustedPtr(IRB, DL, OtherPtr, RelOffset, OtherPtrTy);
2557 Src = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
2559 Src = extractVector(IRB, Src, BeginIndex, EndIndex, "vec");
2561 Src = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
2563 Src = convertValue(DL, IRB, Src, IntTy);
2565 Src = extractInteger(DL, IRB, Src, SubIntTy, Offset, "extract");
2567 Src = IRB.CreateAlignedLoad(SrcPtr, Align, II.isVolatile(),
2572 Value *Old = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
2574 Src = insertVector(IRB, Old, Src, BeginIndex, "vec");
2576 Value *Old = IRB.CreateAlignedLoad(&NewAI, NewAI.getAlignment(),
2578 Old = convertValue(DL, IRB, Old, IntTy);
2580 Src = insertInteger(DL, IRB, Old, Src, Offset, "insert");
2581 Src = convertValue(DL, IRB, Src, NewAllocaTy);
2585 IRB.CreateAlignedStore(Src, DstPtr, Align, II.isVolatile()));
2610 getAdjustedAllocaPtr(IRB, NewBeginOffset, II.getArgOperand(1)->getType());
2613 New = IRB.CreateLifetimeStart(Ptr, Size);
2615 New = IRB.CreateLifetimeEnd(Ptr, Size);
2662 Value *NewPtr = getAdjustedAllocaPtr(IRB, BeginOffset, OldPtr->getType());
2743 IRBuilderTy IRB;
2757 : IRB(InsertionPoint), GEPIndices(1, IRB.getInt32(0)), Ptr(Ptr) {}
2784 GEPIndices.push_back(IRB.getInt32(Idx));
2799 GEPIndices.push_back(IRB.getInt32(Idx));
2820 Value *GEP = IRB.CreateInBoundsGEP(Ptr, GEPIndices, Name + ".gep");
2821 Value *Load = IRB.CreateLoad(GEP, Name + ".load");
2822 Agg = IRB.CreateInsertValue(Agg, Load, Indices, Name + ".insert");
2851 Value *Store = IRB.CreateStore(
2852 IRB.CreateExtractValue(Agg, Indices, Name + ".extract"),
2853 IRB.CreateInBoundsGEP(Ptr, GEPIndices, Name + ".gep"));