Home | History | Annotate | Download | only in CodeGen

Lines Matching refs:Builder

63   CGBuilderTy &Builder;
69 : CGF(cgf), Builder(CGF.Builder), IgnoreResultAssign(ira),
170 return Builder.CreateFCmpUNE(V, Zero, "tobool");
177 return Builder.CreateICmpNE(V, Zero, "tobool");
185 if (ZI->getOperand(0)->getType() == Builder.getInt1Ty()) {
196 return Builder.CreateIsNotNull(V, "tobool");
226 return Builder.getInt(E->getValue());
250 return Builder.CreateBitCast(V, ConvertType(E->getType()));
419 return llvm::ConstantInt::get(Builder.getInt32Ty(), E->getValue());
423 return llvm::ConstantInt::get(Builder.getInt1Ty(), E->getValue());
446 return Builder.getInt1(E->getValue());
454 return Builder.CreateMul(Ops.LHS, Ops.RHS, "mul");
457 return Builder
469 return Builder.CreateFMul(Ops.LHS, Ops.RHS, "mul");
470 return Builder.CreateMul(Ops.LHS, Ops.RHS, "mul");
488 return Builder.CreateAnd(Ops.LHS, Ops.RHS, "and");
491 return Builder.CreateXor(Ops.LHS, Ops.RHS, "xor");
494 return Builder.CreateOr(Ops.LHS, Ops.RHS, "or");
626 Check = Builder.CreateICmpULE(Src, Max);
629 llvm::Value *GE = Builder.CreateICmpSGE(Src, Min);
630 llvm::Value *LE = Builder.CreateICmpSLE(Src, Max);
631 Check = Builder.CreateAnd(GE, LE);
678 Builder.CreateFCmpOGT(Src, llvm::ConstantFP::get(VMContext, MinSrc));
680 Builder.CreateFCmpOLT(Src, llvm::ConstantFP::get(VMContext, MaxSrc));
681 Check = Builder.CreateAnd(GE, LE);
716 Builder.CreateFCmpOGT(AbsSrc, llvm::ConstantFP::get(VMContext, MinBad));
718 Builder.CreateFCmpOLT(AbsSrc, llvm::ConstantFP::get(VMContext, MaxBad));
719 Check = Builder.CreateNot(Builder.CreateAnd(GE, LE));
763 return Builder.CreateCall(
771 Src = Builder.CreateCall(
776 Src = Builder.CreateFPExt(Src, CGF.CGM.FloatTy, "conv");
793 return Builder.CreateBitCast(Src, DstTy, "conv");
801 Builder.CreateIntCast(Src, MiddleTy, InputSigned, "conv");
803 return Builder.CreateIntToPtr(IntResult, DstTy, "conv");
809 return Builder.CreatePtrToInt(Src, DstTy, "conv");
822 return Builder.CreateVectorSplat(NumElements, Src, "splat");
828 return Builder.CreateBitCast(Src, DstTy, "conv");
848 return Builder.CreateCall(
851 return Builder.CreateFPTrunc(Src, DstTy);
862 Res = Builder.CreateIntCast(Src, DstTy, InputSigned, "conv");
864 Res = Builder.CreateSIToFP(Src, DstTy, "conv");
866 Res = Builder.CreateUIToFP(Src, DstTy, "conv");
870 Res = Builder.CreateFPToSI(Src, DstTy, "conv");
872 Res = Builder.CreateFPToUI(Src, DstTy, "conv");
877 Res = Builder.CreateFPTrunc(Src, DstTy, "conv");
879 Res = Builder.CreateFPExt(Src, DstTy, "conv");
885 Res = Builder.CreateCall(
889 Res = Builder.CreateFPTrunc(Res, ResTy, "conv");
909 return Builder.CreateOr(Src.first, Src.second, "tobool");
1002 Mask = Builder.CreateAnd(Mask, MaskBits, "mask");
1015 Value *Indx = Builder.CreateExtractElement(Mask, IIndx, "shuf_idx");
1017 Value *VExt = Builder.CreateExtractElement(LHS, Indx, "shuf_elt");
1018 NewV = Builder.CreateInsertElement(NewV, VExt, IIndx, "shuf_ins");
1033 indices.push_back(Builder.getInt32(Idx.getZExtValue()));
1037 return Builder.CreateShuffleVector(V1, V2, SV, "shuffle");
1079 return Builder.CreateFCmpUNE(Src, Zero, "tobool");
1081 return Builder.CreateICmpNE(Src, Zero, "tobool");
1091 Res = Builder.CreateIntCast(Src, DstTy, InputSigned, "conv");
1093 Res = Builder.CreateSIToFP(Src, DstTy, "conv");
1095 Res = Builder.CreateUIToFP(Src, DstTy, "conv");
1099 Res = Builder.CreateFPToSI(Src, DstTy, "conv");
1101 Res = Builder.CreateFPToUI(Src, DstTy, "conv");
1106 Res = Builder.CreateFPTrunc(Src, DstTy, "conv");
1108 Res = Builder.CreateFPExt(Src, DstTy, "conv");
1121 return Builder.getInt(Value);
1146 return Builder.CreateExtractElement(Base, Idx, "vecext");
1229 Args.push_back(Builder.getInt32(ResElts + C->getZExtValue()));
1238 V = Builder.CreateShuffleVector(LHS, RHS, Mask);
1244 V = Builder.CreateInsertElement(V, Init, Builder.getInt32(CurIdx),
1270 Args.push_back(Builder.getInt32(j));
1288 Args.push_back(Builder.getInt32(j));
1291 Init = Builder.CreateShuffleVector(Init, llvm::UndefValue::get(VVT),
1296 Args.push_back(Builder.getInt32(j));
1298 Args.push_back(Builder.getInt32(j+Offset));
1307 V = Builder.CreateShuffleVector(V, Init, Mask, "vecinit");
1318 Value *Idx = Builder.getInt32(CurIdx);
1320 V = Builder.CreateInsertElement(V, Init, Idx, "vecinit");
1368 Addr = Builder.CreateElementBitCast(Addr, CGF.ConvertTypeForMem(DestTy));
1394 return Builder.CreateBitCast(Src, DstTy);
1400 return Builder.CreatePointerBitCastOrAddrSpaceCast(Src,
1516 Builder.CreateIntCast(Src, MiddleTy, InputSigned, "conv");
1518 return Builder.CreateIntToPtr(IntResult, ConvertType(DestTy));
1522 return Builder.CreatePtrToInt(Visit(E), ConvertType(DestTy));
1533 return Builder.CreateVectorSplat(NumElements, Elt, "splat");
1614 return Builder.CreateAdd(InVal, Amount, Name);
1617 return Builder.CreateNSWAdd(InVal, Amount, Name);
1639 llvm::Value *True = CGF.EmitToMemory(Builder.getTrue(), type);
1641 Builder.CreateStore(True, LV.getAddress(), LV.isVolatileQualified())
1643 return Builder.getTrue();
1647 return Builder.CreateAtomicRMW(
1665 llvm::Value *old = Builder.CreateAtomicRMW(aop,
1667 return isPre ? Builder.CreateBinOp(op, old, amt) : old;
1672 llvm::BasicBlock *startBB = Builder.GetInsertBlock();
1675 Builder.CreateBr(opBB);
1676 Builder.SetInsertPoint(opBB);
1677 atomicPHI = Builder.CreatePHI(value->getType(), 2);
1693 value = Builder.getTrue();
1709 value = Builder.CreateAdd(value, amt, isInc ? "inc" : "dec");
1720 if (!isInc) numElts = Builder.CreateNSWNeg(numElts, "vla.negsize");
1722 value = Builder.CreateGEP(value, numElts, "vla.inc");
1724 value = Builder.CreateInBoundsGEP(value, numElts, "vla.inc");
1728 llvm::Value *amt = Builder.getInt32(amount);
1732 value = Builder.CreateGEP(value, amt, "incdec.funcptr");
1734 value = Builder.CreateInBoundsGEP(value, amt, "incdec.funcptr");
1735 value = Builder.CreateBitCast(value, input->getType());
1739 llvm::Value *amt = Builder.getInt32(amount);
1741 value = Builder.CreateGEP(value, amt, "incdec.ptr");
1743 value = Builder.CreateInBoundsGEP(value, amt, "incdec.ptr");
1751 value = Builder.CreateAdd(value, amt, isInc ? "inc" : "dec");
1753 value = Builder.CreateFAdd(
1767 value = Builder.CreateCall(
1772 value = Builder.CreateFPExt(input, CGF.CGM.FloatTy, "incdec.conv");
1798 value = Builder.CreateFAdd(value, amt, isInc ? "inc" : "dec");
1802 value = Builder.CreateCall(
1807 value = Builder.CreateFPTrunc(value, input->getType(), "incdec.conv");
1822 value = Builder.CreateGEP(value, sizeValue, "incdec.objptr");
1824 value = Builder.CreateInBoundsGEP(value, sizeValue, "incdec.objptr");
1825 value = Builder.CreateBitCast(value, input->getType());
1829 llvm::BasicBlock *opBB = Builder.GetInsertBlock();
1836 Builder.CreateCondBr(success, contBB, opBB);
1837 Builder.SetInsertPoint(contBB);
1874 return Builder.CreateNot(Op, "neg");
1884 Result = Builder.CreateFCmp(llvm::CmpInst::FCMP_OEQ, Oper, Zero, "cmp");
1886 Result = Builder.CreateICmp(llvm::CmpInst::ICMP_EQ, Oper, Zero, "cmp");
1887 return Builder.CreateSExt(Result, ConvertType(E->getType()), "sext");
1896 BoolVal = Builder.CreateNot(BoolVal, "lnot");
1899 return Builder.CreateZExt(BoolVal, ConvertType(E->getType()), "lnot.ext");
1906 return Builder.getInt(Value);
1922 Idx = Builder.CreateIntCast(Idx, ResultType, IdxSigned, "conv");
1933 Offset = Builder.CreateMul(Idx, ElemSize);
1986 Result = Builder.CreateAdd(Result, Offset);
2018 size = CGF.Builder.CreateNUWMul(CGF.CGM.getSize(eltSize), numElts);
2033 return Builder.getInt(E->EvaluateKnownConstInt(CGF.getContext()));
2151 Builder.CreateAtomicRMW(aop, LHSLV.getPointer(), amt,
2158 llvm::BasicBlock *startBB = Builder.GetInsertBlock();
2162 Builder.CreateBr(opBB);
2163 Builder.SetInsertPoint(opBB);
2164 atomicPHI = Builder.CreatePHI(OpInfo.LHS->getType(), 2);
2183 llvm::BasicBlock *opBB = Builder.GetInsertBlock();
2190 Builder.CreateCondBr(success, contBB, opBB);
2191 Builder.SetInsertPoint(contBB);
2234 Checks.push_back(std::make_pair(Builder.CreateICmpNE(Ops.RHS, Zero),
2243 Builder.getInt(llvm::APInt::getSignedMinValue(Ty->getBitWidth()));
2246 llvm::Value *LHSCmp = Builder.CreateICmpNE(Ops.LHS, IntMin);
2247 llvm::Value *RHSCmp = Builder.CreateICmpNE(Ops.RHS, NegOne);
2248 llvm::Value *NotOverflow = Builder.CreateOr(LHSCmp, RHSCmp, "or");
2268 llvm::Value *NonZero = Builder.CreateFCmpUNE(Ops.RHS, Zero);
2275 llvm::Value *Val = Builder.CreateFDiv(Ops.LHS, Ops.RHS, "div");
2287 return Builder.CreateUDiv(Ops.LHS, Ops.RHS, "div");
2289 return Builder.CreateSDiv(Ops.LHS, Ops.RHS, "div");
2303 return Builder.CreateURem(Ops.LHS, Ops.RHS, "rem");
2305 return Builder.CreateSRem(Ops.LHS, Ops.RHS, "rem");
2343 Value *resultAndOverflow = Builder.CreateCall(intrinsic, {Ops.LHS, Ops.RHS});
2344 Value *result = Builder.CreateExtractValue(resultAndOverflow, 0);
2345 Value *overflow = Builder.CreateExtractValue(resultAndOverflow, 1);
2355 llvm::Value *NotOverflow = Builder.CreateNot(overflow);
2360 CGF.EmitTrapCheck(Builder.CreateNot(overflow));
2365 llvm::BasicBlock *initialBB = Builder.GetInsertBlock();
2371 Builder.CreateCondBr(overflow, overflowBB, continueBB);
2375 Builder.SetInsertPoint(overflowBB);
2386 llvm::Value *lhs = Builder.CreateSExt(Ops.LHS, CGF.Int64Ty);
2387 llvm::Value *rhs = Builder.CreateSExt(Ops.RHS, CGF.Int64Ty);
2394 Builder.getInt8(OpID),
2395 Builder.getInt8(cast<llvm::IntegerType>(opTy)->getBitWidth())
2401 handlerResult = Builder.CreateTrunc(handlerResult, opTy);
2402 Builder.CreateBr(continueBB);
2404 Builder.SetInsertPoint(continueBB);
2405 llvm::PHINode *phi = Builder.CreatePHI(opTy, 2);
2436 index = CGF.Builder.CreateIntCast(index, CGF.PtrDiffTy, isSigned,
2442 index = CGF.Builder.CreateNeg(index, "idx.neg");
2457 index = CGF.Builder.CreateMul(index, objectSize);
2459 Value *result = CGF.Builder.CreateBitCast(pointer, CGF.VoidPtrTy);
2460 result = CGF.Builder.CreateGEP(result, index, "add.ptr");
2461 return CGF.Builder.CreateBitCast(result, pointer->getType());
2475 index = CGF.Builder.CreateMul(index, numElements, "vla.index");
2476 pointer = CGF.Builder.CreateGEP(pointer, index, "add.ptr");
2478 index = CGF.Builder.CreateNSWMul(index, numElements, "vla.index");
2479 pointer = CGF.Builder.CreateInBoundsGEP(pointer, index, "add.ptr");
2488 Value *result = CGF.Builder.CreateBitCast(pointer, CGF.VoidPtrTy);
2489 result = CGF.Builder.CreateGEP(result, index, "add.ptr");
2490 return CGF.Builder.CreateBitCast(result, pointer->getType());
2494 return CGF.Builder.CreateGEP(pointer, index, "add.ptr");
2496 return CGF.Builder.CreateInBoundsGEP(pointer, index, "add.ptr");
2505 const CodeGenFunction &CGF, CGBuilderTy &Builder,
2513 Builder.CreateFSub(
2518 Builder.CreateFSub(
2523 Value *FMulAdd = Builder.CreateCall(
2538 Builder,
2560 return buildFMulAdd(LHSBinOp, op.RHS, CGF, Builder, false, isSub);
2565 return buildFMulAdd(RHSBinOp, op.LHS, CGF, Builder, isSub, false);
2579 return Builder.CreateAdd(op.LHS, op.RHS, "add");
2582 return Builder.CreateNSWAdd(op.LHS, op.RHS, "add");
2595 if (Value *FMulAdd = tryEmitFMulAdd(op, CGF, Builder))
2598 return Builder.CreateFAdd(op.LHS, op.RHS, "add");
2601 return Builder.CreateAdd(op.LHS, op.RHS, "add");
2610 return Builder.CreateSub(op.LHS, op.RHS, "sub");
2613 return Builder.CreateNSWSub(op.LHS, op.RHS, "sub");
2626 if (Value *FMulAdd = tryEmitFMulAdd(op, CGF, Builder, true))
2628 return Builder.CreateFSub(op.LHS, op.RHS, "sub");
2631 return Builder.CreateSub(op.LHS, op.RHS, "sub");
2643 = Builder.CreatePtrToInt(op.LHS, CGF.PtrDiffTy, "sub.ptr.lhs.cast");
2645 = Builder.CreatePtrToInt(op.RHS, CGF.PtrDiffTy, "sub.ptr.rhs.cast");
2646 Value *diffInChars = Builder.CreateSub(LHS, RHS, "sub.ptr.sub");
2665 divisor = CGF.Builder.CreateNUWMul(CGF.CGM.getSize(eltSize), divisor);
2689 return Builder.CreateExactSDiv(diffInChars, divisor, "sub.ptr.div");
2706 RHS = Builder.CreateIntCast(RHS, Ops.LHS->getType(), false, "sh_prom");
2714 Builder.CreateAnd(RHS, GetWidthMinusOneValue(Ops.LHS, RHS), "shl.mask");
2720 llvm::Value *ValidExponent = Builder.CreateICmpULE(RHS, WidthMinusOne);
2731 llvm::BasicBlock *Orig = Builder.GetInsertBlock();
2734 Builder.CreateCondBr(ValidExponent, CheckShiftBase, Cont);
2737 Builder.CreateLShr(Ops.LHS,
2738 Builder.CreateSub(WidthMinusOne, RHS, "shl.zeros",
2747 BitsShiftedOff = Builder.CreateLShr(BitsShiftedOff, One);
2750 llvm::Value *ValidBase = Builder.CreateICmpEQ(BitsShiftedOff, Zero);
2752 llvm::PHINode *BaseCheck = Builder.CreatePHI(ValidBase->getType(), 2);
2753 BaseCheck->addIncoming(Builder.getTrue(), Orig);
2762 return Builder.CreateShl(Ops.LHS, RHS, "shl");
2770 RHS = Builder.CreateIntCast(RHS, Ops.LHS->getType(), false, "sh_prom");
2775 Builder.CreateAnd(RHS, GetWidthMinusOneValue(Ops.LHS, RHS), "shr.mask");
2780 Builder.CreateICmpULE(RHS, GetWidthMinusOneValue(Ops.LHS, RHS));
2785 return Builder.CreateLShr(Ops.LHS, RHS, "shr");
2786 return Builder.CreateAShr(Ops.LHS, RHS, "shr");
2901 Value *CR6Param = Builder.getInt32(CR6);
2903 Result = Builder.CreateCall(F, {CR6Param, FirstVecArg, SecondVecArg});
2909 Result = Builder.CreateFCmp(FCmpOpc, LHS, RHS, "cmp");
2911 Result = Builder.CreateICmp(SICmpOpc, LHS, RHS, "cmp");
2914 Result = Builder.CreateICmp(UICmpOpc, LHS, RHS, "cmp");
2920 return Builder.CreateSExt(Result, ConvertType(E->getType()), "sext");
2949 ResultR = Builder.CreateFCmp(FCmpOpc, LHS.first, RHS.first, "cmp.r");
2950 ResultI = Builder.CreateFCmp(FCmpOpc, LHS.second, RHS.second, "cmp.i");
2954 ResultR = Builder.CreateICmp(UICmpOpc, LHS.first, RHS.first, "cmp.r");
2955 ResultI = Builder.CreateICmp(UICmpOpc, LHS.second, RHS.second, "cmp.i");
2959 Result = Builder.CreateAnd(ResultR, ResultI, "and.ri");
2963 Result = Builder.CreateOr(ResultR, ResultI, "or.ri");
3037 LHS = Builder.CreateFCmp(llvm::CmpInst::FCMP_UNE, LHS, Zero, "cmp");
3038 RHS = Builder.CreateFCmp(llvm::CmpInst::FCMP_UNE, RHS, Zero, "cmp");
3040 LHS = Builder.CreateICmp(llvm::CmpInst::ICMP_NE, LHS, Zero, "cmp");
3041 RHS = Builder.CreateICmp(llvm::CmpInst::ICMP_NE, RHS, Zero, "cmp");
3043 Value *And = Builder.CreateAnd(LHS, RHS);
3044 return Builder.CreateSExt(And, ConvertType(E->getType()), "sext");
3058 return Builder.CreateZExtOrBitCast(RHSCond, ResTy, "land.ext");
3091 RHSBlock = Builder.GetInsertBlock();
3103 return Builder.CreateZExtOrBitCast(PN, ResTy, "land.ext");
3115 LHS = Builder.CreateFCmp(llvm::CmpInst::FCMP_UNE, LHS, Zero, "cmp");
3116 RHS = Builder.CreateFCmp(llvm::CmpInst::FCMP_UNE, RHS, Zero, "cmp");
3118 LHS = Builder.CreateICmp(llvm::CmpInst::ICMP_NE, LHS, Zero, "cmp");
3119 RHS = Builder.CreateICmp(llvm::CmpInst::ICMP_NE, RHS, Zero, "cmp");
3121 Value *Or = Builder.CreateOr(LHS, RHS);
3122 return Builder.CreateSExt(Or, ConvertType(E->getType()), "sext");
3136 return Builder.CreateZExtOrBitCast(RHSCond, ResTy, "lor.ext");
3173 RHSBlock = Builder.GetInsertBlock();
3181 return Builder.CreateZExtOrBitCast(PN, ResTy, "lor.ext");
3263 llvm::Value *TestMSB = Builder.CreateICmpSLT(CondV, zeroVec);
3264 llvm::Value *tmp = Builder.CreateSExt(TestMSB,
3268 llvm::Value *tmp2 = Builder.CreateNot(tmp);
3276 RHSTmp = Builder.CreateBitCast(RHS, tmp2->getType());
3277 LHSTmp = Builder.CreateBitCast(LHS, tmp->getType());
3281 llvm::Value *tmp3 = Builder.CreateAnd(RHSTmp, tmp2);
3282 llvm::Value *tmp4 = Builder.CreateAnd(LHSTmp, tmp);
3283 llvm::Value *tmp5 = Builder.CreateOr(tmp3, tmp4, "cond");
3285 tmp5 = Builder.CreateBitCast(tmp5, RHS->getType());
3305 return Builder.CreateSelect(CondV, LHS, RHS, "cond");
3322 LHSBlock = Builder.GetInsertBlock();
3323 Builder.CreateBr(ContBlock);
3330 RHSBlock = Builder.GetInsertBlock();
3340 llvm::PHINode *PN = Builder.CreatePHI(LHS->getType(), 2, "cond");
3368 llvm::Value *Val = Builder.CreateLoad(ArgPtr);
3373 Val = Builder.CreateIntToPtr(Val, ArgTy);
3375 Val = Builder.CreateTrunc(Val, ArgTy);
3386 static Value *ConvertVec3AndVec4(CGBuilderTy &Builder, CodeGenFunction &CGF,
3390 Args.push_back(Builder.getInt32(0));
3391 Args.push_back(Builder.getInt32(1));
3392 Args.push_back(Builder.getInt32(2));
3396 return Builder.CreateShuffleVector(Src, UnV, Mask);
3412 Src = ConvertVec3AndVec4(Builder, CGF, Src, 4);
3413 Src = Builder.CreateBitCast(Src, DstTy);
3423 Src = Builder.CreateBitCast(Src, Vec4Ty);
3424 Src = ConvertVec3AndVec4(Builder, CGF, Src, 3);
3429 return Builder.CreateBitCast(Src, DstTy, "astype");
3492 Addr = Builder.CreateElementBitCast(Addr, ConvertType(E->getType()));