Lines Matching full:builder
62 CGBuilderTy &Builder;
68 : CGF(cgf), Builder(CGF.Builder), IgnoreResultAssign(ira),
128 return Builder.CreateFCmpUNE(V, Zero, "tobool");
135 return Builder.CreateICmpNE(V, Zero, "tobool");
143 if (ZI->getOperand(0)->getType() == Builder.getInt1Ty()) {
154 return Builder.CreateIsNotNull(V, "tobool");
183 return Builder.getInt(E->getValue());
207 return Builder.CreateBitCast(V, ConvertType(E->getType()));
368 return Builder.getInt1(E->getValue());
376 return llvm::ConstantInt::get(Builder.getInt32Ty(), E->getValue());
380 return llvm::ConstantInt::get(Builder.getInt1Ty(), E->getValue());
403 return Builder.getInt1(E->getValue());
411 return Builder.CreateMul(Ops.LHS, Ops.RHS, "mul");
414 return Builder.CreateNSWMul(Ops.LHS, Ops.RHS, "mul");
425 return Builder.CreateFMul(Ops.LHS, Ops.RHS, "mul");
426 return Builder.CreateMul(Ops.LHS, Ops.RHS, "mul");
444 return Builder.CreateAnd(Ops.LHS, Ops.RHS, "and");
447 return Builder.CreateXor(Ops.LHS, Ops.RHS, "xor");
450 return Builder.CreateOr(Ops.LHS, Ops.RHS, "or");
582 Check = Builder.CreateICmpULE(Src, Max);
585 llvm::Value *GE = Builder.CreateICmpSGE(Src, Min);
586 llvm::Value *LE = Builder.CreateICmpSLE(Src, Max);
587 Check = Builder.CreateAnd(GE, LE);
634 Builder.CreateFCmpOGT(Src, llvm::ConstantFP::get(VMContext, MinSrc));
636 Builder.CreateFCmpOLT(Src, llvm::ConstantFP::get(VMContext, MaxSrc));
637 Check = Builder.CreateAnd(GE, LE);
672 Builder.CreateFCmpOGT(AbsSrc, llvm::ConstantFP::get(VMContext, MinBad));
674 Builder.CreateFCmpOLT(AbsSrc, llvm::ConstantFP::get(VMContext, MaxBad));
675 Check = Builder.CreateNot(Builder.CreateAnd(GE, LE));
704 Src = Builder.CreateCall(CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_from_fp16), Src);
725 return Builder.CreateBitCast(Src, DstTy, "conv");
733 Builder.CreateIntCast(Src, MiddleTy, InputSigned, "conv");
735 return Builder.CreateIntToPtr(IntResult, DstTy, "conv");
741 return Builder.CreatePtrToInt(Src, DstTy, "conv");
752 return Builder.CreateVectorSplat(NumElements, Elt, "splat");
758 return Builder.CreateBitCast(Src, DstTy, "conv");
778 Res = Builder.CreateIntCast(Src, DstTy, InputSigned, "conv");
780 Res = Builder.CreateSIToFP(Src, DstTy, "conv");
782 Res = Builder.CreateUIToFP(Src, DstTy, "conv");
786 Res = Builder.CreateFPToSI(Src, DstTy, "conv");
788 Res = Builder.CreateFPToUI(Src, DstTy, "conv");
793 Res = Builder.CreateFPTrunc(Src, DstTy, "conv");
795 Res = Builder.CreateFPExt(Src, DstTy, "conv");
800 Res = Builder.CreateCall(CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_to_fp16), Res);
820 return Builder.CreateOr(Src.first, Src.second, "tobool");
911 concat.push_back(Builder.getInt32(2*i));
912 concat.push_back(Builder.getInt32(2*i+1));
916 LHS = Builder.CreateShuffleVector(LHS, RHS, CV, "concat");
931 Mask = Builder.CreateAnd(Mask, MaskBits, "mask");
943 Value *IIndx = Builder.getInt32(i);
944 Value *Indx = Builder.CreateExtractElement(Mask, IIndx, "shuf_idx");
945 Indx = Builder.CreateZExt(Indx, CGF.Int32Ty, "idx_zext");
947 Value *VExt = Builder.CreateExtractElement(LHS, Indx, "shuf_elt");
948 NewV = Builder.CreateInsertElement(NewV, VExt, IIndx, "shuf_ins");
963 indices.push_back(Builder.getInt32(Idx.getZExtValue()));
967 return Builder.CreateShuffleVector(V1, V2, SV, "shuffle");
976 return Builder.getInt(Value);
1002 Idx = Builder.CreateIntCast(Idx, CGF.Int32Ty, IdxSigned, "vecidxcast");
1003 return Builder.CreateExtractElement(Base, Idx, "vecext");
1075 Args.push_back(Builder.getInt32(ResElts + C->getZExtValue()));
1084 V = Builder.CreateShuffleVector(LHS, RHS, Mask);
1090 V = Builder.CreateInsertElement(V, Init, Builder.getInt32(CurIdx),
1116 Args.push_back(Builder.getInt32(j));
1134 Args.push_back(Builder.getInt32(j));
1137 Init = Builder.CreateShuffleVector(Init, llvm::UndefValue::get(VVT),
1142 Args.push_back(Builder.getInt32(j));
1144 Args.push_back(Builder.getInt32(j+Offset));
1153 V = Builder.CreateShuffleVector(V, Init, Mask, "vecinit");
1164 Value *Idx = Builder.getInt32(CurIdx);
1166 V = Builder.CreateInsertElement(V, Init, Idx, "vecinit");
1213 V = Builder.CreateBitCast(V,
1223 return Builder.CreateBitCast(Src, ConvertType(DestTy));
1276 V = Builder.CreateStructGEP(V, 0, "arraydecay");
1281 return CGF.Builder.CreateBitCast(V, ConvertType(CE->getType()));
1353 Builder.CreateIntCast(Src, MiddleTy, InputSigned, "conv");
1355 return Builder.CreateIntToPtr(IntResult, ConvertType(DestTy));
1359 return Builder.CreatePtrToInt(Visit(E), ConvertType(DestTy));
1373 return Builder.CreateVectorSplat(NumElements, Elt, "splat");;
1435 return Builder.CreateAdd(InVal, NextVal, IsInc ? "inc" : "dec");
1438 return Builder.CreateNSWAdd(InVal, NextVal, IsInc ? "inc" : "dec");
1467 llvm::Value *True = CGF.EmitToMemory(Builder.getTrue(), type);
1469 Builder.Insert(new llvm::StoreInst(True,
1473 return Builder.getTrue();
1477 return Builder.CreateAtomicRMW(llvm::AtomicRMWInst::Xchg,
1494 llvm::Value *old = Builder.CreateAtomicRMW(aop,
1496 return isPre ? Builder.CreateBinOp(op, old, amt) : old;
1501 llvm::BasicBlock *startBB = Builder.GetInsertBlock();
1504 Builder.CreateBr(opBB);
1505 Builder.SetInsertPoint(opBB);
1506 atomicPHI = Builder.CreatePHI(value->getType(), 2);
1522 value = Builder.getTrue();
1547 value = Builder.CreateAdd(value, amt, isInc ? "inc" : "dec");
1557 if (!isInc) numElts = Builder.CreateNSWNeg(numElts, "vla.negsize");
1559 value = Builder.CreateGEP(value, numElts, "vla.inc");
1561 value = Builder.CreateInBoundsGEP(value, numElts, "vla.inc");
1565 llvm::Value *amt = Builder.getInt32(amount);
1569 value = Builder.CreateGEP(value, amt, "incdec.funcptr");
1571 value = Builder.CreateInBoundsGEP(value, amt, "incdec.funcptr");
1572 value = Builder.CreateBitCast(value, input->getType());
1576 llvm::Value *amt = Builder.getInt32(amount);
1578 value = Builder.CreateGEP(value, amt, "incdec.ptr");
1580 value = Builder.CreateInBoundsGEP(value, amt, "incdec.ptr");
1588 value = Builder.CreateAdd(value, amt, isInc ? "inc" : "dec");
1590 value = Builder.CreateFAdd(
1604 Builder.CreateCall(CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_from_fp16),
1621 value = Builder.CreateFAdd(value, amt, isInc ? "inc" : "dec");
1625 Builder.CreateCall(CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_to_fp16),
1639 value = Builder.CreateGEP(value, sizeValue, "incdec.objptr");
1641 value = Builder.CreateInBoundsGEP(value, sizeValue, "incdec.objptr");
1642 value = Builder.CreateBitCast(value, input->getType());
1646 llvm::BasicBlock *opBB = Builder.GetInsertBlock();
1648 llvm::Value *old = Builder.CreateAtomicCmpXchg(LV.getAddress(), atomicPHI,
1651 llvm::Value *success = Builder.CreateICmpEQ(old, atomicPHI);
1652 Builder.CreateCondBr(success, contBB, opBB);
1653 Builder.SetInsertPoint(contBB);
1690 return Builder.CreateNot(Op, "neg");
1700 Result = Builder.CreateFCmp(llvm::CmpInst::FCMP_OEQ, Oper, Zero, "cmp");
1702 Result = Builder.CreateICmp(llvm::CmpInst::ICMP_EQ, Oper, Zero, "cmp");
1703 return Builder
1712 BoolVal = Builder.CreateNot(BoolVal, "lnot");
1715 return Builder.CreateZExt(BoolVal, ConvertType(E->getType()), "lnot.ext");
1722 return Builder.getInt(Value);
1738 Idx = Builder.CreateIntCast(Idx, ResultType, IdxSigned, "conv");
1749 Offset = Builder.CreateMul(Idx, ElemSize);
1802 Result = Builder.CreateAdd(Result, Offset);
1834 size = CGF.Builder.CreateNUWMul(CGF.CGM.getSize(eltSize), numElts);
1842 return Builder.getInt(E->EvaluateKnownConstInt(CGF.getContext()));
1956 Builder.CreateAtomicRMW(aop, LHSLV.getAddress(), amt,
1963 llvm::BasicBlock *startBB = Builder.GetInsertBlock();
1967 Builder.CreateBr(opBB);
1968 Builder.SetInsertPoint(opBB);
1969 atomicPHI = Builder.CreatePHI(OpInfo.LHS->getType(), 2);
1986 llvm::BasicBlock *opBB = Builder.GetInsertBlock();
1988 llvm::Value *old = Builder.CreateAtomicCmpXchg(LHSLV.getAddress(), atomicPHI,
1991 llvm::Value *success = Builder.CreateICmpEQ(old, atomicPHI);
1992 Builder.CreateCondBr(success, contBB, opBB);
1993 Builder.SetInsertPoint(contBB);
2036 Cond = Builder.CreateICmpNE(Ops.RHS, Zero);
2043 Builder.getInt(llvm::APInt::getSignedMinValue(Ty->getBitWidth()));
2046 llvm::Value *LHSCmp = Builder.CreateICmpNE(Ops.LHS, IntMin);
2047 llvm::Value *RHSCmp = Builder.CreateICmpNE(Ops.RHS, NegOne);
2048 llvm::Value *Overflow = Builder.CreateOr(LHSCmp, RHSCmp, "or");
2049 Cond = Cond ? Builder.CreateAnd(Cond, Overflow, "and") : Overflow;
2065 EmitBinOpCheck(Builder.CreateFCmpUNE(Ops.RHS, Zero), Ops);
2069 llvm::Value *Val = Builder.CreateFDiv(Ops.LHS, Ops.RHS, "div");
2081 return Builder.CreateUDiv(Ops.LHS, Ops.RHS, "div");
2083 return Builder.CreateSDiv(Ops.LHS, Ops.RHS, "div");
2096 return Builder.CreateURem(Ops.LHS, Ops.RHS, "rem");
2098 return Builder.CreateSRem(Ops.LHS, Ops.RHS, "rem");
2136 Value *resultAndOverflow = Builder.CreateCall2(intrinsic, Ops.LHS, Ops.RHS);
2137 Value *result = Builder.CreateExtractValue(resultAndOverflow, 0);
2138 Value *overflow = Builder.CreateExtractValue(resultAndOverflow, 1);
2147 EmitBinOpCheck(Builder.CreateNot(overflow), Ops);
2149 CGF.EmitTrapCheck(Builder.CreateNot(overflow));
2154 llvm::BasicBlock *initialBB = Builder.GetInsertBlock();
2160 Builder.CreateCondBr(overflow, overflowBB, continueBB);
2164 Builder.SetInsertPoint(overflowBB);
2175 llvm::Value *lhs = Builder.CreateSExt(Ops.LHS, CGF.Int64Ty);
2176 llvm::Value *rhs = Builder.CreateSExt(Ops.RHS, CGF.Int64Ty);
2183 Builder.getInt8(OpID),
2184 Builder.getInt8(cast<llvm::IntegerType>(opTy)->getBitWidth())
2190 handlerResult = Builder.CreateTrunc(handlerResult, opTy);
2191 Builder.CreateBr(continueBB);
2193 Builder.SetInsertPoint(continueBB);
2194 llvm::PHINode *phi = Builder.CreatePHI(opTy, 2);
2225 index = CGF.Builder.CreateIntCast(index, CGF.PtrDiffTy, isSigned,
2231 index = CGF.Builder.CreateNeg(index, "idx.neg");
2246 index = CGF.Builder.CreateMul(index, objectSize);
2248 Value *result = CGF.Builder.CreateBitCast(pointer, CGF.VoidPtrTy);
2249 result = CGF.Builder.CreateGEP(result, index, "add.ptr");
2250 return CGF.Builder.CreateBitCast(result, pointer->getType());
2264 index = CGF.Builder.CreateMul(index, numElements, "vla.index");
2265 pointer = CGF.Builder.CreateGEP(pointer, index, "add.ptr");
2267 index = CGF.Builder.CreateNSWMul(index, numElements, "vla.index");
2268 pointer = CGF.Builder.CreateInBoundsGEP(pointer, index, "add.ptr");
2277 Value *result = CGF.Builder.CreateBitCast(pointer, CGF.VoidPtrTy);
2278 result = CGF.Builder.CreateGEP(result, index, "add.ptr");
2279 return CGF.Builder.CreateBitCast(result, pointer->getType());
2283 return CGF.Builder.CreateGEP(pointer, index, "add.ptr");
2285 return CGF.Builder.CreateInBoundsGEP(pointer, index, "add.ptr");
2294 const CodeGenFunction &CGF, CGBuilderTy &Builder,
2302 Builder.CreateFSub(
2307 Builder.CreateFSub(
2313 Builder.CreateCall3(
2328 const CodeGenFunction &CGF, CGBuilderTy &Builder,
2349 return buildFMulAdd(LHSBinOp, op.RHS, CGF, Builder, false, isSub);
2356 return buildFMulAdd(RHSBinOp, op.LHS, CGF, Builder, isSub, false);
2371 return Builder.CreateAdd(op.LHS, op.RHS, "add");
2374 return Builder.CreateNSWAdd(op.LHS, op.RHS, "add");
2386 if (Value *FMulAdd = tryEmitFMulAdd(op, CGF, Builder))
2389 return Builder.CreateFAdd(op.LHS, op.RHS, "add");
2392 return Builder.CreateAdd(op.LHS, op.RHS, "add");
2401 return Builder.CreateSub(op.LHS, op.RHS, "sub");
2404 return Builder.CreateNSWSub(op.LHS, op.RHS, "sub");
2416 if (Value *FMulAdd = tryEmitFMulAdd(op, CGF, Builder, true))
2418 return Builder.CreateFSub(op.LHS, op.RHS, "sub");
2421 return Builder.CreateSub(op.LHS, op.RHS, "sub");
2433 = Builder.CreatePtrToInt(op.LHS, CGF.PtrDiffTy, "sub.ptr.lhs.cast");
2435 = Builder.CreatePtrToInt(op.RHS, CGF.PtrDiffTy, "sub.ptr.rhs.cast");
2436 Value *diffInChars = Builder.CreateSub(LHS, RHS, "sub.ptr.sub");
2455 divisor = CGF.Builder.CreateNUWMul(CGF.CGM.getSize(eltSize), divisor);
2479 return Builder.CreateExactSDiv(diffInChars, divisor, "sub.ptr.div");
2496 RHS = Builder.CreateIntCast(RHS, Ops.LHS->getType(), false, "sh_prom");
2501 llvm::Value *Valid = Builder.CreateICmpULE(RHS, WidthMinusOne);
2504 llvm::BasicBlock *Orig = Builder.GetInsertBlock();
2507 Builder.CreateCondBr(Valid, CheckBitsShifted, Cont);
2513 Builder.CreateLShr(Ops.LHS,
2514 Builder.CreateSub(WidthMinusOne, RHS, "shl.zeros",
2523 BitsShiftedOff = Builder.CreateLShr(BitsShiftedOff, One);
2526 llvm::Value *SecondCheck = Builder.CreateICmpEQ(BitsShiftedOff, Zero);
2528 llvm::PHINode *P = Builder.CreatePHI(Valid->getType(), 2);
2538 RHS = Builder.CreateAnd(RHS, GetWidthMinusOneValue(Ops.LHS, RHS), "shl.mask");
2540 return Builder.CreateShl(Ops.LHS, RHS, "shl");
2548 RHS = Builder.CreateIntCast(RHS, Ops.LHS->getType(), false, "sh_prom");
2552 EmitBinOpCheck(Builder.CreateICmpULE(RHS, GetWidthMinusOneValue(Ops.LHS, RHS)), Ops);
2556 RHS = Builder.CreateAnd(RHS, GetWidthMinusOneValue(Ops.LHS, RHS), "shr.mask");
2559 return Builder.CreateLShr(Ops.LHS, RHS, "shr");
2560 return Builder
2672 Value *CR6Param = Builder.getInt32(CR6);
2674 Result = Builder.CreateCall3(F, CR6Param, FirstVecArg, SecondVecArg, "");
2679 Result = Builder.CreateFCmp((llvm::CmpInst::Predicate)FCmpOpc,
2682 Result = Builder.CreateICmp((llvm::ICmpInst::Predicate)SICmpOpc,
2686 Result = Builder.CreateICmp((llvm::ICmpInst::Predicate)UICmpOpc,
2693 return Builder.CreateSExt(Result, ConvertType(E->getType()), "sext");
2704 ResultR = Builder.CreateFCmp((llvm::FCmpInst::Predicate)FCmpOpc,
2706 ResultI = Builder.CreateFCmp((llvm::FCmpInst::Predicate)FCmpOpc,
2711 ResultR = Builder.CreateICmp((llvm::ICmpInst::Predicate)UICmpOpc,
2713 ResultI = Builder.CreateICmp((llvm::ICmpInst::Predicate)UICmpOpc,
2718 Result = Builder.CreateAnd(ResultR, ResultI, "and.ri");
2722 Result = Builder.CreateOr(ResultR, ResultI, "or.ri");
2791 LHS = Builder.CreateFCmp(llvm::CmpInst::FCMP_UNE, LHS, Zero, "cmp");
2792 RHS = Builder.CreateFCmp(llvm::CmpInst::FCMP_UNE, RHS, Zero, "cmp");
2794 LHS = Builder.CreateICmp(llvm::CmpInst::ICMP_NE, LHS, Zero, "cmp");
2795 RHS = Builder.CreateICmp(llvm::CmpInst::ICMP_NE, RHS, Zero, "cmp");
2797 Value *And = Builder.CreateAnd(LHS, RHS);
2798 return Builder.CreateSExt(And, ConvertType(E->getType()), "sext");
2810 return Builder.CreateZExtOrBitCast(RHSCond, ResTy, "land.ext");
2841 RHSBlock = Builder.GetInsertBlock();
2847 Builder.SetCurrentDebugLocation(llvm::DebugLoc());
2852 return Builder.CreateZExtOrBitCast(PN, ResTy, "land.ext");
2862 LHS = Builder.CreateFCmp(llvm::CmpInst::FCMP_UNE, LHS, Zero, "cmp");
2863 RHS = Builder.CreateFCmp(llvm::CmpInst::FCMP_UNE, RHS, Zero, "cmp");
2865 LHS = Builder.CreateICmp(llvm::CmpInst::ICMP_NE, LHS, Zero, "cmp");
2866 RHS = Builder.CreateICmp(llvm::CmpInst::ICMP_NE, RHS, Zero, "cmp");
2868 Value *Or = Builder.CreateOr(LHS, RHS);
2869 return Builder.CreateSExt(Or, ConvertType(E->getType()), "sext");
2881 return Builder.CreateZExtOrBitCast(RHSCond, ResTy, "lor.ext");
2915 RHSBlock = Builder.GetInsertBlock();
2923 return Builder.CreateZExtOrBitCast(PN, ResTy, "lor.ext");
3008 llvm::Value *TestMSB = Builder.CreateICmpSLT(CondV, zeroVec);
3009 llvm::Value *tmp = Builder.CreateSExt(TestMSB,
3013 llvm::Value *tmp2 = Builder.CreateNot(tmp);
3021 RHSTmp = Builder.CreateBitCast(RHS, tmp2->getType());
3022 LHSTmp = Builder.CreateBitCast(LHS, tmp->getType());
3026 llvm::Value *tmp3 = Builder.CreateAnd(RHSTmp, tmp2);
3027 llvm::Value *tmp4 = Builder.CreateAnd(LHSTmp, tmp);
3028 llvm::Value *tmp5 = Builder.CreateOr(tmp3, tmp4, "cond");
3030 tmp5 = Builder.CreateBitCast(tmp5, RHS->getType());
3048 return Builder.CreateSelect(CondV, LHS, RHS, "cond");
3063 LHSBlock = Builder.GetInsertBlock();
3064 Builder.CreateBr(ContBlock);
3071 RHSBlock = Builder.GetInsertBlock();
3081 llvm::PHINode *PN = Builder.CreatePHI(LHS->getType(), 2, "cond");
3097 return Builder.CreateVAArg(ArgValue, ConvertType(VE->getType()));
3100 return Builder.CreateLoad(ArgPtr);
3134 Src = Builder.CreateBitCast(Src, newSrcTy, "astypeCast");
3140 Args.push_back(Builder.getInt32(0));
3141 Args.push_back(Builder.getInt32(1));
3142 Args.push_back(Builder.getInt32(2));
3149 return Builder.CreateShuffleVector(Src, UnV, Mask, "astype");
3153 return Builder.CreateBitCast(Src, DstTy, "astype");
3218 Builder.CreateStore(Src, V);
3230 V = Builder.CreateBitCast(V, ClassPtrTy);