Lines Matching refs:Builder
55 return Builder.CreateBitCast(value, destType);
514 static llvm::Value *emitHash16Bytes(CGBuilderTy &Builder, llvm::Value *Low,
516 llvm::Value *KMul = Builder.getInt64(0x9ddfea08eb382d69ULL);
517 llvm::Value *K47 = Builder.getInt64(47);
518 llvm::Value *A0 = Builder.CreateMul(Builder.CreateXor(Low, High), KMul);
519 llvm::Value *A1 = Builder.CreateXor(Builder.CreateLShr(A0, K47), A0);
520 llvm::Value *B0 = Builder.CreateMul(Builder.CreateXor(High, A1), KMul);
521 llvm::Value *B1 = Builder.CreateXor(Builder.CreateLShr(B0, K47), B0);
522 return Builder.CreateMul(B1, KMul);
554 llvm::Value *IsNonNull = Builder.CreateIsNotNull(Ptr);
561 Builder.CreateCondBr(IsNonNull, Rest, Done);
577 llvm::Value *Min = Builder.getFalse();
578 llvm::Value *CastAddr = Builder.CreateBitCast(Ptr, Int8PtrTy);
580 Builder.CreateICmpUGE(Builder.CreateCall(F, {CastAddr, Min}),
595 Builder.CreateAnd(Builder.CreatePtrToInt(Ptr, IntPtrTy),
598 Builder.CreateICmpEQ(Align, llvm::ConstantInt::get(IntPtrTy, 0));
645 Address VPtrAddr(Builder.CreateBitCast(Ptr, VPtrTy), getPointerAlign());
646 llvm::Value *VPtrVal = Builder.CreateLoad(VPtrAddr);
647 llvm::Value *High = Builder.CreateZExt(VPtrVal, Int64Ty);
649 llvm::Value *Hash = emitHash16Bytes(Builder, Low, High);
650 Hash = Builder.CreateTrunc(Hash, IntPtrTy);
657 llvm::Value *Slot = Builder.CreateAnd(Hash,
660 llvm::Value *Indices[] = { Builder.getInt32(0), Slot };
662 Builder.CreateAlignedLoad(Builder.CreateInBoundsGEP(Cache, Indices),
669 llvm::Value *EqualHash = Builder.CreateICmpEQ(CacheVal, Hash);
683 Builder.CreateBr(Done);
723 return CGF.Builder.getInt32(VT->getNumElements());
734 return CGF.Builder.getInt(CAT->getSize());
756 llvm::Value *IndexVal = Builder.CreateIntCast(Index, SizeTy, IndexSigned);
757 llvm::Value *BoundVal = Builder.CreateIntCast(Bound, SizeTy, false);
764 llvm::Value *Check = Accessed ? Builder.CreateICmpULT(IndexVal, BoundVal)
765 : Builder.CreateICmpULE(IndexVal, BoundVal);
782 NextVal = Builder.CreateAdd(InVal.first, NextVal, isInc ? "inc" : "dec");
791 NextVal = Builder.CreateFAdd(InVal.first, NextVal, isInc ? "inc" : "dec");
861 return Builder.CreateBitCast(Addr, ConvertType(E->getType()));
1282 Address Cast = Builder.CreateElementBitCast(Addr, vec4Ty, "castToVec4");
1284 llvm::Value *V = Builder.CreateLoad(Cast, Volatile, "loadVec4");
1287 V = Builder.CreateShuffleVector(V, llvm::UndefValue::get(vec4Ty),
1300 llvm::LoadInst *Load = Builder.CreateLoad(Addr, Volatile);
1303 Load->getContext(), llvm::ConstantAsMetadata::get(Builder.getInt32(1)));
1325 Check = Builder.CreateICmpULE(
1328 llvm::Value *Upper = Builder.CreateICmpSLE(
1330 llvm::Value *Lower = Builder.CreateICmpSGE(
1332 Check = Builder.CreateAnd(Upper, Lower);
1355 return Builder.CreateZExt(Value, ConvertTypeForMem(Ty), "frombool");
1368 return Builder.CreateTrunc(Value, Builder.getInt1Ty(), "tobool");
1389 llvm::Constant *Mask[] = {Builder.getInt32(0), Builder.getInt32(1),
1390 Builder.getInt32(2),
1391 llvm::UndefValue::get(Builder.getInt32Ty())};
1393 Value = Builder.CreateShuffleVector(Value,
1399 Addr = Builder.CreateElementBitCast(Addr, SrcTy, "storetmp");
1413 llvm::StoreInst *Store = Builder.CreateStore(Value, Addr, Volatile);
1417 llvm::ConstantAsMetadata::get(Builder.getInt32(1)));
1467 llvm::LoadInst *Load = Builder.CreateLoad(LV.getVectorAddress(),
1469 return RValue::get(Builder.CreateExtractElement(Load, LV.getVectorIdx(),
1493 llvm::Value *Val = Builder.CreateLoad(Ptr, LV.isVolatileQualified(), "bf.load");
1499 Val = Builder.CreateShl(Val, HighBits, "bf.shl");
1501 Val = Builder.CreateAShr(Val, Info.Offset + HighBits, "bf.ashr");
1504 Val = Builder.CreateLShr(Val, Info.Offset, "bf.lshr");
1506 Val = Builder.CreateAnd(Val, llvm::APInt::getLowBitsSet(Info.StorageSize,
1510 Val = Builder.CreateIntCast(Val, ResLTy, Info.IsSigned, "bf.cast");
1518 llvm::Value *Vec = Builder.CreateLoad(LV.getExtVectorAddress(),
1529 return RValue::get(Builder.CreateExtractElement(Vec, Elt));
1537 Mask.push_back(Builder.getInt32(getAccessedFieldNo(i, Elts)));
1540 Vec = Builder.CreateShuffleVector(Vec, llvm::UndefValue::get(Vec->getType()),
1553 Builder.CreateElementBitCast(VectorAddress, VectorElementTy,
1560 Builder.CreateConstInBoundsGEP(CastToPointerElement, ix,
1582 llvm::Value *Call = Builder.CreateCall(
1585 Call = Builder.CreateIntToPtr(Call, OrigTy);
1598 llvm::Value *Vec = Builder.CreateLoad(Dst.getVectorAddress(),
1600 Vec = Builder.CreateInsertElement(Vec, Src.getScalarVal(),
1602 Builder.CreateStore(Vec, Dst.getVectorAddress(),
1662 RHS = Builder.CreatePtrToInt(RHS, ResultType, "sub.ptr.rhs.cast");
1664 Builder.CreatePtrToInt(LvalueDst.getPointer(), ResultType,
1666 llvm::Value *BytesBetween = Builder.CreateSub(LHS, RHS, "ivar.offset");
1692 SrcVal = Builder.CreateIntCast(SrcVal, Ptr.getElementType(),
1701 Builder.CreateLoad(Ptr, Dst.isVolatileQualified(), "bf.load");
1705 SrcVal = Builder.CreateAnd(SrcVal,
1711 SrcVal = Builder.CreateShl(SrcVal, Info.Offset, "bf.shl");
1714 Val = Builder.CreateAnd(Val,
1721 SrcVal = Builder.CreateOr(Val, SrcVal, "bf.set");
1727 Builder.CreateStore(SrcVal, Ptr, Dst.isVolatileQualified());
1738 ResultVal = Builder.CreateShl(ResultVal, HighBits, "bf.result.shl");
1739 ResultVal = Builder.CreateAShr(ResultVal, HighBits, "bf.result.ashr");
1743 ResultVal = Builder.CreateIntCast(ResultVal, ResLTy, Info.IsSigned,
1753 llvm::Value *Vec = Builder.CreateLoad(Dst.getExtVectorAddress(),
1768 Mask[getAccessedFieldNo(i, Elts)] = Builder.getInt32(i);
1771 Vec = Builder.CreateShuffleVector(SrcVal,
1781 ExtMask.push_back(Builder.getInt32(i));
1785 Builder.CreateShuffleVector(SrcVal,
1791 Mask.push_back(Builder.getInt32(i));
1801 Mask[getAccessedFieldNo(i, Elts)] = Builder.getInt32(i+NumDstElts);
1803 Vec = Builder.CreateShuffleVector(Vec, ExtSrcVal, MaskV);
1812 Vec = Builder.CreateInsertElement(Vec, SrcVal, Elt);
1815 Builder.CreateStore(Vec, Dst.getExtVectorAddress(),
1837 Value = Builder.CreatePtrToInt(Value, Ty);
1838 Builder.CreateCall(
1947 return CGF.Builder.CreateBitCast(V, IRType->getPointerTo(AS), Name);
1954 Addr = CGF.Builder.CreateElementBitCast(Addr, RealVarTy);
1961 llvm::Value *Ptr = Builder.CreateLoad(Addr);
1977 llvm::Value *Addr = Builder.CreateLoad(Ptr);
2030 V = CGF.Builder.CreateBitCast(V, CGF.ConvertType(NoProtoType));
2336 Builder.getInt16(TypeKind), Builder.getInt16(TypeInfo),
2361 V = Builder.CreateBitCast(V, llvm::Type::getIntNTy(getLLVMContext(),
2368 return Builder.CreateZExt(V, TargetTy);
2373 Builder.CreateStore(V, Ptr);
2376 return Builder.CreatePtrToInt(V, TargetTy);
2431 llvm::Constant *Data[] = {Filename, Builder.getInt32(Line),
2432 Builder.getInt32(Column)};
2491 CGF.Builder.CreateUnreachable();
2493 CGF.Builder.CreateBr(ContBB);
2516 Cond = Cond ? Builder.CreateAnd(Cond, Check) : Check;
2526 JointCond = Builder.CreateAnd(FatalCond, RecoverableCond);
2543 llvm::Instruction *Branch = Builder.CreateCondBr(JointCond, Cont, Handlers);
2567 Args.push_back(Builder.CreateBitCast(InfoPtr, Int8PtrTy));
2590 Builder.CreateCondBr(FatalCond, NonFatalHandlerBB, FatalHandlerBB);
2608 llvm::BranchInst *BI = Builder.CreateCondBr(Cond, Cont, CheckBB);
2631 CheckCall = Builder.CreateCall(
2633 {TypeId, Ptr, Builder.CreateBitCast(InfoPtr, Int8PtrTy)});
2638 CheckCall = Builder.CreateCall(SlowPathFn, {TypeId, Ptr});
2683 Builder.CreateICmpNE(Data, llvm::ConstantPointerNull::get(Int8PtrTy));
2691 llvm::Value *V = Builder.CreateConstGEP2_32(
2693 Builder.CreatePointerCast(Data, CfiCheckFailDataTy->getPointerTo(0)), 0,
2696 llvm::Value *CheckKind = Builder.CreateLoad(CheckKindAddr);
2701 llvm::Value *ValidVtable = Builder.CreateZExt(
2702 Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::type_test),
2718 Builder.CreateICmpNE(CheckKind, llvm::ConstantInt::get(Int8Ty, Kind));
2739 Builder.CreateCondBr(Checked, Cont, TrapBB);
2744 Builder.CreateUnreachable();
2746 Builder.CreateCondBr(Checked, Cont, TrapBB);
2753 llvm::CallInst *TrapCall = Builder.CreateCall(CGM.getIntrinsic(IntrID));
2776 Addr = Builder.CreateElementBitCast(Addr, NewTy);
2783 Addr = Builder.CreateStructGEP(Addr, 0, CharUnits::Zero(), "arraydecay");
2787 return Builder.CreateElementBitCast(Addr, ConvertTypeForMem(EltType));
2812 return CGF.Builder.CreateInBoundsGEP(ptr, indices, name);
2814 return CGF.Builder.CreateGEP(ptr, indices, name);
2895 Idx = Builder.CreateIntCast(Idx, IntPtrTy, IdxSigned, "idxprom");
2924 Idx = Builder.CreateMul(Idx, numElements);
2926 Idx = Builder.CreateNSWMul(Idx, numElements);
2938 llvm::Value *ScaledIdx = Builder.CreateMul(Idx, InterfaceSizeVal);
2948 Addr = Builder.CreateElementBitCast(Addr, Int8Ty);
2958 Addr = Builder.CreateBitCast(Addr, OrigBaseTy);
3013 Addr = CGF.Builder.CreateElementBitCast(Addr, NewTy);
3020 Addr = CGF.Builder.CreateStructGEP(Addr, 0, CharUnits::Zero(),
3024 return CGF.Builder.CreateElementBitCast(Addr,
3028 return Address(CGF.Builder.CreateLoad(BaseLVal.getAddress()), Align);
3052 Idx = Builder.CreateIntCast(
3084 ? Builder.CreateIntCast(
3090 ? Builder.CreateIntCast(
3094 Idx = Builder.CreateAdd(LowerBoundVal, LengthVal, "lb_add_len",
3098 Idx = Builder.CreateSub(
3118 auto *LengthVal = Builder.CreateIntCast(
3121 Idx = Builder.CreateSub(
3150 Idx = Builder.CreateMul(Idx, NumElements);
3152 Idx = Builder.CreateNSWMul(Idx, NumElements);
3212 Builder.CreateStore(Vec, VecMem);
3307 return CGF.Builder.CreateStructGEP(base, idx, offset, field->getName());
3323 Addr = Builder.CreateStructGEP(Addr, Idx, Info.StorageOffset,
3329 Addr = Builder.CreateElementBitCast(Addr, FieldIntTy);
3355 llvm::LoadInst *load = Builder.CreateLoad(addr, "ref");
3388 addr = Builder.CreateElementBitCast(addr,
3433 V = Builder.CreateElementBitCast(V, llvmType, Field->getName());
3525 lhsBlock = Builder.GetInsertBlock();
3527 Builder.CreateBr(contBlock);
3537 rhsBlock = Builder.GetInsertBlock();
3542 llvm::PHINode *phi = Builder.CreatePHI(lhs->getPointer()->getType(),
3681 Address V = Builder.CreateBitCast(LV.getAddress(),
3693 Address V = Builder.CreateElementBitCast(LV.getAddress(),
3785 EmitARCRelease(Builder.CreateLoad(BaseValue,
3893 return Builder.CreateElementBitCast(CGM.GetAddrOfUuidDescriptor(E),
4031 llvm::Value *CalleePrefixStruct = Builder.CreateBitCast(
4034 Builder.CreateConstGEP2_32(PrefixStructTy, CalleePrefixStruct, 0, 0);
4036 Builder.CreateAlignedLoad(CalleeSigPtr, getIntAlign());
4037 llvm::Value *CalleeSigMatch = Builder.CreateICmpEQ(CalleeSig, PrefixSig);
4041 Builder.CreateCondBr(CalleeSigMatch, TypeCheck, Cont);
4045 Builder.CreateConstGEP2_32(PrefixStructTy, CalleePrefixStruct, 0, 1);
4047 Builder.CreateAlignedLoad(CalleeRTTIPtr, getPointerAlign());
4049 Builder.CreateICmpEQ(CalleeRTTI, FTRTTIConst);
4057 Builder.CreateBr(Cont);
4072 llvm::Value *CastedCallee = Builder.CreateBitCast(Callee, Int8PtrTy);
4073 llvm::Value *TypeTest = Builder.CreateCall(
4094 Args.add(RValue::get(Builder.CreateBitCast(Chain, CGM.VoidPtrTy)),
4125 Callee = Builder.CreateBitCast(Callee, CalleeTy, "callee.knr.cast");