Home | History | Annotate | Download | only in CodeGen

Lines Matching full:builder

271   CGBuilderTy &Builder = CGF.Builder;
289 llvm::Value *RawAdj = Builder.CreateExtractValue(MemFnPtr, 1, "memptr.adj");
294 Adj = Builder.CreateAShr(Adj, ptrdiff_1, "memptr.adj.shifted");
298 llvm::Value *Ptr = Builder.CreateBitCast(This, Builder.getInt8PtrTy());
299 Ptr = Builder.CreateInBoundsGEP(Ptr, Adj);
300 This = Builder.CreateBitCast(Ptr, This->getType(), "this.adjusted");
303 llvm::Value *FnAsInt = Builder.CreateExtractValue(MemFnPtr, 0, "memptr.ptr");
309 IsVirtual = Builder.CreateAnd(RawAdj, ptrdiff_1);
311 IsVirtual = Builder.CreateAnd(FnAsInt, ptrdiff_1);
312 IsVirtual = Builder.CreateIsNotNull(IsVirtual, "memptr.isvirtual");
313 Builder.CreateCondBr(IsVirtual, FnVirtual, FnNonVirtual);
321 llvm::Type *VTableTy = Builder.getInt8PtrTy();
322 llvm::Value *VTable = Builder.CreateBitCast(This, VTableTy->getPointerTo());
323 VTable = Builder.CreateLoad(VTable, "memptr.vtable");
328 VTableOffset = Builder.CreateSub(VTableOffset, ptrdiff_1);
329 VTable = Builder.CreateGEP(VTable, VTableOffset);
332 VTable = Builder.CreateBitCast(VTable, FTy->getPointerTo()->getPointerTo());
333 llvm::Value *VirtualFn = Builder.CreateLoad(VTable, "memptr.virtualfn");
340 Builder.CreateIntToPtr(FnAsInt, FTy->getPointerTo(), "memptr.nonvirtualfn");
344 llvm::PHINode *Callee = Builder.CreatePHI(FTy->getPointerTo(), 2);
358 CGBuilderTy &Builder = CGF.Builder;
363 Base = Builder.CreateBitCast(Base, Builder.getInt8Ty()->getPointerTo(AS));
366 llvm::Value *Addr = Builder.CreateInBoundsGEP(Base, MemPtr, "memptr.offset");
372 return Builder.CreateBitCast(Addr, PType);
416 CGBuilderTy &Builder = CGF.Builder;
427 dst = Builder.CreateNSWSub(src, adj, "adj");
429 dst = Builder.CreateNSWAdd(src, adj, "adj");
433 llvm::Value *isNull = Builder.CreateICmpEQ(src, null, "memptr.isnull");
434 return Builder.CreateSelect(isNull, src, dst);
444 llvm::Value *srcAdj = Builder.CreateExtractValue(src, 1, "src.adj");
447 dstAdj = Builder.CreateNSWSub(srcAdj, adj, "adj");
449 dstAdj = Builder.CreateNSWAdd(srcAdj, adj, "adj");
451 return Builder.CreateInsertValue(src, dstAdj, 1);
613 CGBuilderTy &Builder = CGF.Builder;
630 return Builder.CreateICmp(Eq, L, R);
642 llvm::Value *LPtr = Builder.CreateExtractValue(L, 0, "lhs.memptr.ptr");
643 llvm::Value *RPtr = Builder.CreateExtractValue(R, 0, "rhs.memptr.ptr");
647 llvm::Value *PtrEq = Builder.CreateICmp(Eq, LPtr, RPtr, "cmp.ptr");
653 llvm::Value *EqZero = Builder.CreateICmp(Eq, LPtr, Zero, "cmp.ptr.null");
657 llvm::Value *LAdj = Builder.CreateExtractValue(L, 1, "lhs.memptr.adj");
658 llvm::Value *RAdj = Builder.CreateExtractValue(R, 1, "rhs.memptr.adj");
659 llvm::Value *AdjEq = Builder.CreateICmp(Eq, LAdj, RAdj, "cmp.adj");
667 llvm::Value *OrAdj = Builder.CreateOr(LAdj, RAdj, "or.adj");
668 llvm::Value *OrAdjAnd1 = Builder.CreateAnd(OrAdj, One);
669 llvm::Value *OrAdjAnd1EqZero = Builder.CreateICmp(Eq, OrAdjAnd1, Zero,
671 EqZero = Builder.CreateBinOp(And, EqZero, OrAdjAnd1EqZero);
675 llvm::Value *Result = Builder.CreateBinOp(Or, EqZero, AdjEq);
676 Result = Builder.CreateBinOp(And, PtrEq, Result,
685 CGBuilderTy &Builder = CGF.Builder;
692 return Builder.CreateICmpNE(MemPtr, NegativeOne, "memptr.tobool");
696 llvm::Value *Ptr = Builder.CreateExtractValue(MemPtr, 0, "memptr.ptr");
699 llvm::Value *Result = Builder.CreateICmpNE(Ptr, Zero, "memptr.tobool");
705 llvm::Value *Adj = Builder.CreateExtractValue(MemPtr, 1, "memptr.adj");
706 llvm::Value *VirtualBit = Builder.CreateAnd(Adj, One, "memptr.virtualbit");
707 llvm::Value *IsVirtual = Builder.CreateICmpNE(VirtualBit, Zero,
709 Result = Builder.CreateOr(Result, IsVirtual);
731 CGF.Builder.CreateConstInBoundsGEP1_64(vtable, -2, "complete-offset.ptr");
732 llvm::LoadInst *offset = CGF.Builder.CreateLoad(offsetPtr);
736 ptr = CGF.Builder.CreateBitCast(ptr, CGF.Int8PtrTy);
737 return CGF.Builder.CreateInBoundsGEP(ptr, offset);
750 CGF.Builder.CreateConstGEP1_64(VTablePtr, VBaseOffsetOffset.getQuantity(),
752 VBaseOffsetPtr = CGF.Builder.CreateBitCast(VBaseOffsetPtr,
756 CGF.Builder.CreateLoad(VBaseOffsetPtr, "vbase.offset");
855 = CGF.Builder.CreateLoad(CGF.GetAddrOfLocalVar(getVTTDecl(CGF)),
868 CGF.Builder.CreateStore(getThisValue(CGF), CGF.ReturnValue);
955 CookiePtr = CGF.Builder.CreateConstInBoundsGEP1_64(CookiePtr,
960 = CGF.Builder.CreateBitCast(CookiePtr,
962 CGF.Builder.CreateStore(NumElements, NumElementsPtr);
966 return CGF.Builder.CreateConstInBoundsGEP1_64(NewPtr,
979 CGF.Builder.CreateConstInBoundsGEP1_64(numElementsPtr,
984 CGF.Builder.CreateBitCast(numElementsPtr, CGF.SizeTy->getPointerTo(AS));
985 return CGF.Builder.CreateLoad(numElementsPtr);
1015 cookie = CGF.Builder.CreateBitCast(cookie, CGF.SizeTy->getPointerTo(AS));
1018 CGF.Builder.CreateStore(elementSize, cookie);
1021 cookie = CGF.Builder.CreateConstInBoundsGEP1_32(cookie, 1);
1022 CGF.Builder.CreateStore(numElements, cookie);
1027 return CGF.Builder.CreateConstInBoundsGEP1_64(newPtr,
1037 = CGF.Builder.CreateConstInBoundsGEP1_64(allocPtr, CGF.SizeSizeInBytes);
1041 CGF.Builder.CreateBitCast(numElementsPtr, CGF.SizeTy->getPointerTo(AS));
1042 return CGF.Builder.CreateLoad(numElementsPtr);
1099 CGBuilderTy &Builder = CGF.Builder;
1160 llvm::Value *V = Builder.CreateLoad(guard);
1162 V = Builder.CreateAnd(V, Test1);
1163 Builder.CreateIsNull(V, "guard.uninitialized");
1182 Builder.CreateLoad(Builder.CreateBitCast(guard, CGM.Int8PtrTy));
1194 isInitialized = Builder.CreateIsNull(LI, "guard.uninitialized");
1201 Builder.CreateCondBr(isInitialized, InitCheckBlock, EndBlock);
1213 Builder.CreateCondBr(Builder.CreateIsNotNull(V, "tobool"),
1232 Builder.CreateStore(llvm::ConstantInt::get(guardTy, 1), guard);
1382 CGBuilderTy Builder(Entry);
1385 Builder.CreateCall(Init);
1388 llvm::Value *Have = Builder.CreateIsNotNull(Init);
1391 Builder.CreateCondBr(Have, InitBB, ExitBB);
1393 Builder.SetInsertPoint(InitBB);
1394 Builder.CreateCall(Init);
1395 Builder.CreateBr(ExitBB);
1397 Builder.SetInsertPoint(ExitBB);
1404 llvm::LoadInst *LI = Builder.CreateLoad(Val);
1409 Builder.CreateRet(Val);
1422 Val = CGF.Builder.CreateCall(Wrapper);