Lines Matching refs:Builder
67 return CGF.Builder.CreatePtrToInt(V, IntType);
78 return CGF.Builder.CreateIntToPtr(V, ResultType);
104 Args[0] = CGF.Builder.CreateBitCast(DestPtr, IntPtrType);
109 llvm::Value *Result = CGF.Builder.CreateAtomicRMW(
120 Value *BC = CGF.Builder.CreateBitCast(
168 Args[0] = CGF.Builder.CreateBitCast(DestPtr, IntPtrType);
170 llvm::Value *Result = CGF.Builder.CreateAtomicRMW(
172 Result = CGF.Builder.CreateBinOp(Op, Result, Args[1]);
174 Result = CGF.Builder.CreateBinOp(llvm::Instruction::Xor, Result,
202 Args[0] = CGF.Builder.CreateBitCast(DestPtr, IntPtrType);
208 Value *Pair = CGF.Builder.CreateAtomicCmpXchg(
213 return CGF.Builder.CreateZExt(CGF.Builder.CreateExtractValue(Pair, 1),
217 return EmitFromInt(CGF, CGF.Builder.CreateExtractValue(Pair, 0), T,
229 return CGF.Builder.CreateCall(F, Src0);
240 return CGF.Builder.CreateCall(F, { Src0, Src1 });
252 return CGF.Builder.CreateCall(F, { Src0, Src1, Src2 });
263 return CGF.Builder.CreateCall(F, {Src0, Src1});
269 llvm::CallInst *Call = CGF.Builder.CreateCall(F, V);
282 V = CGF.Builder.CreateBitCast(V, IntTy);
294 V = CGF.Builder.CreateLShr(V, ShiftCst);
299 V = CGF.Builder.CreateTrunc(V, IntTy);
302 return CGF.Builder.CreateICmpSLT(V, Zero);
330 llvm::Value *Tmp = CGF.Builder.CreateCall(Callee, {X, Y});
331 Carry = CGF.Builder.CreateExtractValue(Tmp, 1);
332 return CGF.Builder.CreateExtractValue(Tmp, 0);
341 llvm::Instruction *Call = CGF.Builder.CreateCall(F);
394 Builder.CreateBitCast(ArgValue, DestType, ArgValue->getName().data());
397 return Builder.CreateCall(CGM.getIntrinsic(inst), ArgValue);
458 auto *CI = ConstantInt::get(Builder.getInt1Ty(), (Type & 2) >> 1);
460 llvm::Type *Tys[] = {ResType, Builder.getInt8PtrTy(0)};
462 return Builder.CreateCall(F, {EmitScalarExpr(E), CI});
500 DstPtr = Builder.CreateBitCast(DstPtr, Type);
501 SrcPtr = Builder.CreateBitCast(SrcPtr, Type);
502 return RValue::get(Builder.CreateCall(CGM.getIntrinsic(Intrinsic::vacopy),
510 Value *NegOp = Builder.CreateNeg(ArgValue, "neg");
512 Builder.CreateICmpSGE(ArgValue,
516 Builder.CreateSelect(CmpResult, ArgValue, NegOp, "abs");
530 Value *Result = Builder.CreateFRem(Arg1, Arg2, "fmod");
589 Imag = Builder.CreateFSub(Zero, Imag, "sub");
622 Value *ZeroUndef = Builder.getInt1(getTarget().isCLZForZeroUndef());
623 Value *Result = Builder.CreateCall(F, {ArgValue, ZeroUndef});
625 Result = Builder.CreateIntCast(Result, ResultType, /*isSigned*/true,
639 Value *ZeroUndef = Builder.getInt1(getTarget().isCLZForZeroUndef());
640 Value *Result = Builder.CreateCall(F, {ArgValue, ZeroUndef});
642 Result = Builder.CreateIntCast(Result, ResultType, /*isSigned*/true,
657 Builder.CreateAdd(Builder.CreateCall(F, {ArgValue, Builder.getTrue()}),
660 Value *IsZero = Builder.CreateICmpEQ(ArgValue, Zero, "iszero");
661 Value *Result = Builder.CreateSelect(IsZero, Zero, Tmp, "ffs");
663 Result = Builder.CreateIntCast(Result, ResultType, /*isSigned*/true,
677 Value *Tmp = Builder.CreateCall(F, ArgValue);
678 Value *Result = Builder.CreateAnd(Tmp, llvm::ConstantInt::get(ArgType, 1));
680 Result = Builder.CreateIntCast(Result, ResultType, /*isSigned*/true,
693 Value *Result = Builder.CreateCall(F, ArgValue);
695 Result = Builder.CreateIntCast(Result, ResultType, /*isSigned*/true,
718 Builder.CreateCall(FnExpect, {ArgValue, ExpectedValue}, "expval");
740 return RValue::get(Builder.CreateCall(FnAssume, ArgValue));
771 return RValue::get(Builder.CreateCall(F, {Address, RW, Locality, Data}));
775 return RValue::get(Builder.CreateCall(F));
781 return RValue::get(Builder.CreateCall(F, {Begin, End}));
790 EmitCheck(std::make_pair(static_cast<llvm::Value *>(Builder.getFalse()),
795 Builder.CreateUnreachable();
810 return RValue::get(Builder.CreateCall(F, {Base, Exponent}));
827 LHS = Builder.CreateFCmpOGT(LHS, RHS, "cmp");
830 LHS = Builder.CreateFCmpOGE(LHS, RHS, "cmp");
833 LHS = Builder.CreateFCmpOLT(LHS, RHS, "cmp");
836 LHS = Builder.CreateFCmpOLE(LHS, RHS, "cmp");
839 LHS = Builder.CreateFCmpONE(LHS, RHS, "cmp");
842 LHS = Builder.CreateFCmpUNO(LHS, RHS, "cmp");
846 return RValue::get(Builder.CreateZExt(LHS, ConvertType(E->getType())));
850 V = Builder.CreateFCmpUNO(V, V, "cmp");
851 return RValue::get(Builder.CreateZExt(V, ConvertType(E->getType())));
865 Value *FCmp = Builder.CreateFCmp(Pred, Fabs, Infinity, "cmpinf");
866 return RValue::get(Builder.CreateZExt(FCmp, ConvertType(E->getType())));
873 Value *IsInf = Builder.CreateFCmpOEQ(
881 Value *SignResult = Builder.CreateSelect(IsNeg, NegativeOne, One);
882 Value *Result = Builder.CreateSelect(IsInf, SignResult, Zero);
889 Value *Eq = Builder.CreateFCmpOEQ(V, V, "iseq");
893 Builder.CreateFCmpULT(Abs, ConstantFP::getInfinity(V->getType()),"isinf");
897 Builder.CreateFCmpUGE(Abs, ConstantFP::get(V->getContext(), Smallest),
899 V = Builder.CreateAnd(Eq, IsLessThanInf, "and");
900 V = Builder.CreateAnd(V, IsNormal, "and");
901 return RValue::get(Builder.CreateZExt(V, ConvertType(E->getType())));
909 BasicBlock *Begin = Builder.GetInsertBlock();
911 Builder.SetInsertPoint(End);
913 Builder.CreatePHI(ConvertType(E->getArg(0)->getType()), 4,
917 Builder.SetInsertPoint(Begin);
918 Value *IsZero = Builder.CreateFCmpOEQ(V, Constant::getNullValue(Ty),
922 Builder.CreateCondBr(IsZero, End, NotZero);
926 Builder.SetInsertPoint(NotZero);
927 Value *IsNan = Builder.CreateFCmpUNO(V, V, "cmp");
930 Builder.CreateCondBr(IsNan, End, NotNan);
934 Builder.SetInsertPoint(NotNan);
937 Builder.CreateFCmpOEQ(VAbs, ConstantFP::getInfinity(V->getType()),
941 Builder.CreateCondBr(IsInf, End, NotInf);
945 Builder.SetInsertPoint(NotInf);
949 Builder.CreateFCmpUGE(VAbs, ConstantFP::get(V->getContext(), Smallest),
952 Builder.CreateSelect(IsNormal, EmitScalarExpr(E->getArg(2)),
954 Builder.CreateBr(End);
958 Builder.SetInsertPoint(End);
966 return RValue::get(Builder.CreateAlloca(Builder.getInt8Ty(), Size));
974 Builder.CreateMemSet(Dest, Builder.getInt8(0), SizeVal, false);
986 Builder.CreateMemCpy(Dest, Src, SizeVal, false);
1000 Value *SizeVal = llvm::ConstantInt::get(Builder.getContext(), Size);
1001 Builder.CreateMemCpy(Dest, Src, SizeVal, false);
1024 Value *SizeVal = llvm::ConstantInt::get(Builder.getContext(), Size);
1025 Builder.CreateMemMove(Dest, Src, SizeVal, false);
1038 Builder.CreateMemMove(Dest, Src, SizeVal, false);
1044 Value *ByteVal = Builder.CreateTrunc(EmitScalarExpr(E->getArg(1)),
1045 Builder.getInt8Ty());
1049 Builder.CreateMemSet(Dest, ByteVal, SizeVal, false);
1061 Value *ByteVal = Builder.CreateTrunc(EmitScalarExpr(E->getArg(1)),
1062 Builder.getInt8Ty());
1063 Value *SizeVal = llvm::ConstantInt::get(Builder.getContext(), Size);
1064 Builder.CreateMemSet(Dest, ByteVal, SizeVal, false);
1079 return RValue::get(Builder.CreateCall(F,
1086 return RValue::get(Builder.CreateCall(F, Depth));
1092 return RValue::get(Builder.CreateCall(F, Depth));
1130 Builder.CreateCall(F, {Int, Ptr});
1131 Builder.CreateUnreachable();
1140 return RValue::get(Builder.CreateCall(F));
1155 Value *Result = Builder.CreatePtrToInt(Ptr, IntPtrTy, "extend.cast");
1163 return RValue::get(Builder.CreateSExt(Result, Int64Ty, "extend.sext"));
1165 return RValue::get(Builder.CreateZExt(Result, Int64Ty, "extend.zext"));
1173 Builder.CreateCall(CGM.getIntrinsic(Intrinsic::frameaddress),
1175 Builder.CreateStore(FrameAddr, Buf);
1179 Builder.CreateCall(CGM.getIntrinsic(Intrinsic::stacksave));
1181 Builder.CreateConstInBoundsGEP(Buf, 2, getPointerSize());
1182 Builder.CreateStore(StackAddr, StackSaveSlot);
1186 Buf = Builder.CreateBitCast(Buf, Int8PtrTy);
1187 return RValue::get(Builder.CreateCall(F, Buf.getPointer()));
1191 Buf = Builder.CreateBitCast(Buf, Int8PtrTy);
1194 Builder.CreateCall(CGM.getIntrinsic(Intrinsic::eh_sjlj_longjmp), Buf);
1197 Builder.CreateUnreachable();
1350 Ptr = Builder.CreateBitCast(Ptr, ITy->getPointerTo());
1352 Builder.CreateAlignedStore(llvm::Constant::getNullValue(ITy), Ptr,
1366 Builder.CreateFence(llvm::AtomicOrdering::SequentiallyConsistent);
1405 Ptr = Builder.CreateBitCast(Ptr, Int8Ty->getPointerTo(AddrSpace));
1406 Value *NewVal = Builder.getInt8(1);
1414 Result = Builder.CreateAtomicRMW(llvm::AtomicRMWInst::Xchg, Ptr, NewVal,
1419 Result = Builder.CreateAtomicRMW(llvm::AtomicRMWInst::Xchg, Ptr, NewVal,
1423 Result = Builder.CreateAtomicRMW(llvm::AtomicRMWInst::Xchg, Ptr, NewVal,
1428 Result = Builder.CreateAtomicRMW(llvm::AtomicRMWInst::Xchg, Ptr, NewVal,
1432 Result = Builder.CreateAtomicRMW(
1438 return RValue::get(Builder.CreateIsNotNull(Result, "tobool"));
1455 Order = Builder.CreateIntCast(Order, Builder.getInt32Ty(), false);
1456 llvm::SwitchInst *SI = Builder.CreateSwitch(Order, BBs[0]);
1458 Builder.SetInsertPoint(ContBB);
1459 PHINode *Result = Builder.CreatePHI(Int8Ty, 5, "was_set");
1462 Builder.SetInsertPoint(BBs[i]);
1463 AtomicRMWInst *RMW = Builder.CreateAtomicRMW(llvm::AtomicRMWInst::Xchg,
1467 Builder.CreateBr(ContBB);
1470 SI->addCase(Builder.getInt32(0), BBs[0]);
1471 SI->addCase(Builder.getInt32(1), BBs[1]);
1472 SI->addCase(Builder.getInt32(2), BBs[1]);
1473 SI->addCase(Builder.getInt32(3), BBs[2]);
1474 SI->addCase(Builder.getInt32(4), BBs[3]);
1475 SI->addCase(Builder.getInt32(5), BBs[4]);
1477 Builder.SetInsertPoint(ContBB);
1478 return RValue::get(Builder.CreateIsNotNull(Result, "tobool"));
1488 Ptr = Builder.CreateBitCast(Ptr, Int8Ty->getPointerTo(AddrSpace));
1489 Value *NewVal = Builder.getInt8(0);
1493 StoreInst *Store = Builder.CreateStore(NewVal, Ptr, Volatile);
1520 Order = Builder.CreateIntCast(Order, Builder.getInt32Ty(), false);
1521 llvm::SwitchInst *SI = Builder.CreateSwitch(Order, BBs[0]);
1524 Builder.SetInsertPoint(BBs[i]);
1525 StoreInst *Store = Builder.CreateStore(NewVal, Ptr, Volatile);
1527 Builder.CreateBr(ContBB);
1530 SI->addCase(Builder.getInt32(0), BBs[0]);
1531 SI->addCase(Builder.getInt32(3), BBs[1]);
1532 SI->addCase(Builder.getInt32(5), BBs[2]);
1534 Builder.SetInsertPoint(ContBB);
1557 Builder.CreateFence(llvm::AtomicOrdering::Acquire, Scope);
1560 Builder.CreateFence(llvm::AtomicOrdering::Release, Scope);
1563 Builder.CreateFence(llvm::AtomicOrdering::AcquireRelease, Scope);
1566 Builder.CreateFence(llvm::AtomicOrdering::SequentiallyConsistent,
1580 Order = Builder.CreateIntCast(Order, Builder.getInt32Ty(), false);
1581 llvm::SwitchInst *SI = Builder.CreateSwitch(Order, ContBB);
1583 Builder.SetInsertPoint(AcquireBB);
1584 Builder.CreateFence(llvm::AtomicOrdering::Acquire, Scope);
1585 Builder.CreateBr(ContBB);
1586 SI->addCase(Builder.getInt32(1), AcquireBB);
1587 SI->addCase(Builder.getInt32(2), AcquireBB);
1589 Builder.SetInsertPoint(ReleaseBB);
1590 Builder.CreateFence(llvm::AtomicOrdering::Release, Scope);
1591 Builder.CreateBr(ContBB);
1592 SI->addCase(Builder.getInt32(3), ReleaseBB);
1594 Builder.SetInsertPoint(AcqRelBB);
1595 Builder.CreateFence(llvm::AtomicOrdering::AcquireRelease, Scope);
1596 Builder.CreateBr(ContBB);
1597 SI->addCase(Builder.getInt32(4), AcqRelBB);
1599 Builder.SetInsertPoint(SeqCstBB);
1600 Builder.CreateFence(llvm::AtomicOrdering::SequentiallyConsistent, Scope);
1601 Builder.CreateBr(ContBB);
1602 SI->addCase(Builder.getInt32(5), SeqCstBB);
1604 Builder.SetInsertPoint(ContBB);
1624 return RValue::get(Builder.CreateCall(F, Arg0));
1640 return RValue::get(Builder.CreateCall(F, {Base, Exponent}));
1654 Builder.CreateCall(F, {FirstArg, EmitScalarExpr(E->getArg(1)),
1662 Builder.CreateZExt(EmitSignBit(*this, EmitScalarExpr(E->getArg(0))),
1737 llvm::Value *CarryOut = Builder.CreateZExt(Builder.CreateOr(Carry1, Carry2),
1739 Builder.CreateStore(CarryOut, CarryOutPtr);
1793 Left = Builder.CreateIntCast(Left, EncompassingLLVMTy, LeftInfo.Signed);
1794 Right = Builder.CreateIntCast(Right, EncompassingLLVMTy, RightInfo.Signed);
1803 llvm::Value *ResultTrunc = Builder.CreateTrunc(Result, ResultLLVMTy);
1807 llvm::Value *ResultTruncExt = Builder.CreateIntCast(
1810 Builder.CreateICmpNE(Result, ResultTruncExt);
1812 Overflow = Builder.CreateOr(Overflow, TruncationOverflow);
1819 Builder.CreateStore(EmitToMemory(Result, ResultQTy), ResultPtr, isVolatile);
1889 Builder.CreateStore(Sum, SumOutPtr);
1922 Builder.CreateBitCast(EmitScalarExpr(E->getArg(0)), IntPtrType);
1926 Exchange = Builder.CreatePtrToInt(Exchange, IntType);
1929 Builder.CreatePtrToInt(EmitScalarExpr(E->getArg(2)), IntType);
1932 Builder.CreateAtomicCmpXchg(Destination, Comparand, Exchange,
1937 return RValue::get(Builder.CreateIntToPtr(Builder.CreateExtractValue(Result,
1942 AtomicCmpXchgInst *CXI = Builder.CreateAtomicCmpXchg(
1949 return RValue::get(Builder.CreateExtractValue(CXI, 0));
1953 AtomicRMWInst *RMWI = Builder.CreateAtomicRMW(
1959 return RValue::get(Builder.CreateAdd(RMWI, ConstantInt::get(IntTy, 1)));
1963 AtomicRMWInst *RMWI = Builder.CreateAtomicRMW(
1969 return RValue::get(Builder.CreateSub(RMWI, ConstantInt::get(IntTy, 1)));
1972 AtomicRMWInst *RMWI = Builder.CreateAtomicRMW(
1983 Builder.CreateIntToPtr(EmitScalarExpr(E->getArg(0)),
1986 Builder.CreateDefaultAlignedLoad(IntToPtr, /*isVolatile=*/true);
2008 llvm::Value *Buf = Builder.CreateBitOrPointerCast(
2011 Builder.CreateCall(CGM.getIntrinsic(Intrinsic::frameaddress),
2025 llvm::Value *Buf = Builder.CreateBitOrPointerCast(
2042 Builder.CreateCall(CGM.getIntrinsic(Intrinsic::frameaddress),
2081 Value *BCast = Builder.CreatePointerCast(Arg1, I8PTy);
2082 return RValue::get(Builder.CreateCall(
2095 Value *BCast = Builder.CreatePointerCast(Arg3, I8PTy);
2099 Arg2 = Builder.CreateZExtOrTrunc(Arg2, Int32Ty);
2100 return RValue::get(Builder.CreateCall(
2138 Arg1 = Builder.CreateZExtOrTrunc(Arg1, Int32Ty);
2140 Builder.CreateCall(CGM.CreateRuntimeFunction(FTy, Name), {Arg0, Arg1}));
2174 Builder.CreateCall(CGM.CreateRuntimeFunction(FTy, Name), {Arg0, Arg1}));
2192 Builder.CreateCall(CGM.CreateRuntimeFunction(FTy, Name), {Arg0}));
2209 NewArg = Builder.CreateAddrSpaceCast(Arg0, NewArgT);
2211 NewArg = Builder.CreateBitOrPointerCast(Arg0, NewArgT);
2212 auto NewCall = Builder.CreateCall(CGM.CreateRuntimeFunction(FTy,
2214 return RValue::get(Builder.CreateBitOrPointerCast(NewCall,
2240 Builder.CreateBitCast(EmitScalarExpr(E->getArg(3)), Int8PtrTy);
2242 return RValue::get(Builder.CreateCall(
2252 Builder.CreateBitCast(EmitScalarExpr(E->getArg(3)), Int8PtrTy);
2268 ? Builder.CreateZExt(ArgSize, Int32Ty)
2275 Builder.CreateCall(CGM.CreateRuntimeFunction(FTy, Name),
2299 Builder.CreateBitCast(EmitScalarExpr(E->getArg(6)), Int8PtrTy);
2313 Builder.CreateCall(CGM.CreateRuntimeFunction(FTy, Name),
2330 ? Builder.CreateZExt(ArgSize, Int32Ty)
2336 Builder.CreateCall(CGM.CreateRuntimeFunction(FTy, Name),
2344 Arg = Builder.CreateBitCast(Arg, Int8PtrTy);
2346 Builder.CreateCall(CGM.CreateRuntimeFunction(
2353 Arg = Builder.CreateBitCast(Arg, Int8PtrTy);
2354 return RValue::get(Builder.CreateCall(
2443 ArgValue = Builder.CreateBitCast(ArgValue, PTy);
2449 Value *V = Builder.CreateCall(F, Args);
2459 V = Builder.CreateBitCast(V, RetTy);
2569 return Builder.CreateShuffleVector(V, V, SV, "lane");
2581 Ops[j] = Builder.CreateBitCast(Ops[j], ai->getType(), name);
2583 return Builder.CreateCall(F, Ops, name);
2601 Vec = Builder.CreateBitCast(Vec, Ty);
2619 return Builder.CreateLShr(Vec, Shift, name);
2621 return Builder.CreateAShr(Vec, Shift, name);
3320 CGF.Builder.CreateTruncOrBitCast(Ops[j], ArgTy->getVectorElementType());
3322 CGF.Builder.CreateInsertElement(UndefValue::get(ArgTy), Ops[j], C0);
3329 return CGF.Builder.CreateExtractElement(Result, C0);
3331 return CGF.Builder.CreateBitCast(Result, ResultType, s);
3355 return Builder.getInt32(addr.getAlignment().getQuantity());
3374 Ops[0] = Builder.CreateBitCast(Ops[0], SrcTy);
3375 Ops[1] = Builder.CreateBitCast(Ops[1], SrcTy);
3376 Ops[0] = Builder.CreateAdd(Ops[0], Ops[1], "vaddhn");
3381 Ops[0] = Builder.CreateLShr(Ops[0], ShiftAmt, "vaddhn");
3384 return Builder.CreateTrunc(Ops[0], VTy, "vaddhn");
3406 Ops.push_back(Builder.getInt1(getTarget().isCLZForZeroUndef()));
3410 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
3412 return Usgn ? Builder.CreateUIToFP(Ops[0], Ty, "vcvt")
3413 : Builder.CreateSIToFP(Ops[0], Ty, "vcvt");
3443 Ops[0] = Builder.CreateBitCast(Ops[0], GetFloatNeonType(this, Type));
3444 return Usgn ? Builder.CreateFPToUI(Ops[0], Ty, "vcvt")
3445 : Builder.CreateFPToSI(Ops[0], Ty, "vcvt");
3489 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
3490 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
3491 return Builder.CreateShuffleVector(Ops[0], Ops[1], Indices, "vext");
3496 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
3497 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
3498 Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
3501 return Builder.CreateCall(F, {Ops[1], Ops[2], Ops[0]});
3518 Ops[1] = Builder.CreateCall(F, {Ops[1], Align}, NameHint);
3520 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
3521 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
3527 PtrOp0 = Builder.CreateBitCast(PtrOp0, Ty);
3528 LoadInst *Ld = Builder.CreateLoad(PtrOp0);
3530 Ops[0] = Builder.CreateInsertElement(V, Ld, CI);
3542 Ops[I] = Builder.CreateBitCast(Ops[I], Ty);
3544 Ops[1] = Builder.CreateCall(F, makeArrayRef(Ops).slice(1), NameHint);
3546 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
3547 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
3551 Ops[0] = Builder.CreateBitCast(Ops[0], DTy);
3553 return Builder.CreateZExt(Ops[0], Ty, "vmovl");
3554 return Builder.CreateSExt(Ops[0], Ty, "vmovl");
3558 Ops[0] = Builder.CreateBitCast(Ops[0], QTy);
3559 return Builder.CreateTrunc(Ops[0], Ty, "vmovn");
3621 return Builder.CreateShl(Builder.CreateBitCast(Ops[0],Ty), Ops[1],
3625 Ops[0] = Builder.CreateBitCast(Ops[0], SrcTy);
3627 Ops[0] = Builder.CreateZExt(Ops[0], VTy);
3629 Ops[0] = Builder.CreateSExt(Ops[0], VTy);
3631 return Builder.CreateShl(Ops[0], Ops[1], "vshll_n");
3635 Ops[0] = Builder.CreateBitCast(Ops[0], SrcTy);
3638 Ops[0] = Builder.CreateLShr(Ops[0], Ops[1]);
3640 Ops[0] = Builder.CreateAShr(Ops[0], Ops[1]);
3641 return Builder.CreateTrunc(Ops[0], Ty, "vshrn_n");
3669 Ops[0] = Builder.CreateBitCast(Ops[0], SrcTy);
3670 Ops[1] = Builder.CreateBitCast(Ops[1], SrcTy);
3671 Ops[0] = Builder.CreateSub(Ops[0], Ops[1], "vsubhn");
3676 Ops[0] = Builder.CreateLShr(Ops[0], ShiftAmt, "vsubhn");
3679 return Builder.CreateTrunc(Ops[0], VTy, "vsubhn");
3683 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::PointerType::getUnqual(Ty));
3684 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
3685 Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
3694 Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ty, Ops[0], vi);
3695 SV = Builder.CreateShuffleVector(Ops[1], Ops[2], Indices, "vtrn");
3696 SV = Builder.CreateDefaultAlignedStore(SV, Addr);
3702 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
3703 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
3704 Ops[0] = Builder.CreateAnd(Ops[0], Ops[1]);
3705 Ops[0] = Builder.CreateICmp(ICmpInst::ICMP_NE, Ops[0],
3707 return Builder.CreateSExt(Ops[0], Ty, "vtst");
3711 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::PointerType::getUnqual(Ty));
3712 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
3713 Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
3721 Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ty, Ops[0], vi);
3722 SV = Builder.CreateShuffleVector(Ops[1], Ops[2], Indices, "vuzp");
3723 SV = Builder.CreateDefaultAlignedStore(SV, Addr);
3729 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::PointerType::getUnqual(Ty));
3730 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
3731 Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
3740 Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ty, Ops[0], vi);
3741 SV = Builder.CreateShuffleVector(Ops[1], Ops[2], Indices, "vzip");
3742 SV = Builder.CreateDefaultAlignedStore(SV, Addr);
3757 return Builder.CreateBitCast(Result, ResultType, NameHint);
3772 Op = Builder.CreateBitCast(Op, OTy);
3774 Op = Builder.CreateFCmp(Fp, Op, Constant::getNullValue(OTy));
3776 Op = Builder.CreateICmp(Ip, Op, Constant::getNullValue(OTy));
3778 return Builder.CreateSExt(Op, Ty, Name);
3799 TblOps.push_back(CGF.Builder.CreateShuffleVector(Ops[PairPos],
3809 TblOps.push_back(CGF.Builder.CreateShuffleVector(Ops[PairPos],
3850 return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_hint),
3867 CodeGen::CGBuilderTy &Builder = CGF.Builder;
3888 llvm::Value *Call = Builder.CreateCall(F, Metadata);
3892 return Builder.CreateTrunc(Call, ValueType);
3896 return Builder.CreateIntToPtr(Call, ValueType);
3905 ArgValue = Builder.CreateZExt(ArgValue, RegisterType);
3906 return Builder.CreateCall(F, { Metadata, ArgValue });
3911 ArgValue = Builder.CreatePtrToInt(ArgValue, RegisterType);
3912 return Builder.CreateCall(F, { Metadata, ArgValue });
3915 return Builder.CreateCall(F, { Metadata, ArgValue });
3976 return Builder.CreateCall(Emit);
3981 return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_dbg), Option);
3993 return Builder.CreateCall(F, {Address, RW, Locality, IsData});
3997 return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_rbit),
4041 Value *Rt = Builder.CreateTruncOrBitCast(RtAndRt2, Int32Ty);
4042 Value *Rt2 = Builder.CreateLShr(RtAndRt2, C1);
4043 Rt2 = Builder.CreateTruncOrBitCast(Rt2, Int32Ty);
4045 return Builder.CreateCall(F, {Coproc, Opc1, Rt, Rt2, CRm});
4065 Value *RtAndRt2 = Builder.CreateCall(F, {Coproc, Opc1, CRm});
4070 Value *Rt = Builder.CreateExtractValue(RtAndRt2, 1);
4071 Value *Rt1 = Builder.CreateExtractValue(RtAndRt2, 0);
4072 Rt = Builder.CreateZExt(Rt, Int64Ty);
4073 Rt1 = Builder.CreateZExt(Rt1, Int64Ty);
4076 RtAndRt2 = Builder.CreateShl(Rt, ShiftCast, "shl", true);
4077 RtAndRt2 = Builder.CreateOr(RtAndRt2, Rt1);
4079 return Builder.CreateBitCast(RtAndRt2, ConvertType(E->getType()));
4102 Value *Val = Builder.CreateCall(F, Builder.CreateBitCast(LdPtr, Int8PtrTy),
4105 Value *Val0 = Builder.CreateExtractValue(Val, 1);
4106 Value *Val1 = Builder.CreateExtractValue(Val, 0);
4107 Val0 = Builder.CreateZExt(Val0, Int64Ty);
4108 Val1 = Builder.CreateZExt(Val1, Int64Ty);
4111 Val = Builder.CreateShl(Val0, ShiftCst, "shl", true /* nuw */);
4112 Val = Builder.CreateOr(Val, Val1);
4113 return Builder.CreateBitCast(Val, ConvertType(E->getType()));
4124 LoadAddr = Builder.CreateBitCast(LoadAddr, IntResTy->getPointerTo());
4130 Value *Val = Builder.CreateCall(F, LoadAddr, "ldrex");
4133 return Builder.CreateIntToPtr(Val, RealResTy);
4135 Val = Builder.CreateTruncOrBitCast(Val, IntResTy);
4136 return Builder.CreateBitCast(Val, RealResTy);
4151 Builder.CreateStore(Val, Tmp);
4153 Address LdPtr = Builder.CreateBitCast(Tmp,llvm::PointerType::getUnqual(STy));
4154 Val = Builder.CreateLoad(LdPtr);
4156 Value *Arg0 = Builder.CreateExtractValue(Val, 0);
4157 Value *Arg1 = Builder.CreateExtractValue(Val, 1);
4158 Value *StPtr = Builder.CreateBitCast(EmitScalarExpr(E->getArg(1)), Int8PtrTy);
4159 return Builder.CreateCall(F, {Arg0, Arg1, StPtr}, "strexd");
4170 StoreAddr = Builder.CreateBitCast(StoreAddr, StoreTy->getPointerTo());
4173 StoreVal = Builder.CreatePtrToInt(StoreVal, Int32Ty);
4175 StoreVal = Builder.CreateBitCast(StoreVal, StoreTy);
4176 StoreVal = Builder.CreateZExtOrBitCast(StoreVal, Int32Ty);
4183 return Builder.CreateCall(F, {StoreVal, StoreAddr}, "strex");
4188 return Builder.CreateCall(F);
4219 Value *Arg1a = Builder.CreateTruncOrBitCast(Arg1, Int32Ty);
4220 Value *Arg1b = Builder.CreateLShr(Arg1, C1);
4221 Arg1b = Builder.CreateTruncOrBitCast(Arg1b, Int32Ty);
4224 Value *Res = Builder.CreateCall(F, {Arg0, Arg1a});
4225 return Builder.CreateCall(F, {Res, Arg1b});
4227 Arg1 = Builder.CreateZExtOrBitCast(Arg1, Int32Ty);
4230 return Builder.CreateCall(F, {Arg0, Arg1});
4273 return Builder.getInt32(addr.getAlignment().getQuantity());
4363 return Builder.CreateExtractElement(Ops[0], Ops[1], "vget_lane");
4375 return Builder.CreateInsertElement(Ops[1], Ops[0], Ops[2], "vset_lane");
4396 return Builder.CreateCall(F, {Ops[1], Ops[2], Ops[0],
4423 return Builder.CreateCall(F, Ops, "vcvtr");
4454 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
4457 Ops[1] = Builder.CreateShuffleVector(Ops[1], Ops[1], SV);
4463 Value *Ld = Builder.CreateCall(F, {Ops[0], Align});
4467 return Builder.CreateShuffleVector(Ops[1], Ld, SV, "vld1q_lane");
4471 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
4472 PtrOp0 = Builder.CreateElementBitCast(PtrOp0, VTy->getElementType());
4473 Value *Ld = Builder.CreateLoad(PtrOp0);
4474 return Builder.CreateInsertElement(Ops[1], Ld, Ops[2], "vld1_lane");
4496 Ops[1] = Builder.CreateCall(F, {Ops[1], Align}, "vld_dup");
4498 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
4499 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
4525 Ops[1] = Builder.CreateCall(F, Args, "vld_dup");
4528 Value *Val = Builder.CreateExtractValue(Ops[1], i);
4529 Value *Elt = Builder.CreateBitCast(Val, Ty);
4531 Elt = Builder.CreateBitCast(Elt, Val->getType());
4532 Ops[1] = Builder.CreateInsertValue(Ops[1], Elt, i);
4535 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
4536 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
4562 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
4563 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
4566 Ops[1] = Builder.CreateCall(CGM.getIntrinsic(Int, Ty), {Ops[1], Ops[2]});
4567 return Builder.CreateAdd(Ops[0], Ops[1], "vrsra_n");
4578 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
4580 return Builder.CreateAdd(Ops[0], Ops[1]);
4585 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
4587 Ops[1] = Builder.CreateShuffleVector(Ops[1], Ops[1], SV);
4590 return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_neon_vst1,
4595 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
4596 Ops[1] = Builder.CreateExtractElement(Ops[1], Ops[2]);
4598 auto St = BuilderBuilder.CreateBitCast(PtrOp0, Ty));
4679 CodeGen::CGBuilderTy &Builder = CGF.Builder;
4710 Value *CmpRes = Builder.CreateICmp(ICmpInst::ICMP_UGE, Ops[2], EightV);
4711 CmpRes = Builder.CreateSExt(CmpRes, Ty);
4713 Value *EltsFromInput = Builder.CreateAnd(CmpRes, Ops[0]);
4714 Value *EltsFromTbl = Builder.CreateAnd(Builder.CreateNot(CmpRes), TblRes);
4715 return Builder.CreateOr(EltsFromInput, EltsFromTbl, "vtbx");
4728 Value *CmpRes = Builder.CreateICmp(ICmpInst::ICMP_UGE, Ops[4],
4730 CmpRes = Builder.CreateSExt(CmpRes, Ty);
4732 Value *EltsFromInput = Builder.CreateAnd(CmpRes, Ops[0]);
4733 Value *EltsFromTbl = Builder.CreateAnd(Builder.CreateNot(CmpRes), TblRes);
4734 return Builder.CreateOr(EltsFromInput, EltsFromTbl, "vtbx");
4777 Op = Builder.CreateBitCast(Op, Int16Ty);
4780 Op = Builder.CreateInsertElement(V, Op, CI);
4811 return Builder.CreateCall(F, llvm::ConstantInt::get(Int32Ty, HintID));
4834 return Builder.CreateCall(F, {Address, RW, Locality, IsData});
4841 return Builder.CreateCall(
4848 return Builder.CreateCall(
4872 Value *Val = Builder.CreateCall(F, Builder.CreateBitCast(LdPtr, Int8PtrTy),
4875 Value *Val0 = Builder.CreateExtractValue(Val, 1);
4876 Value *Val1 = Builder.CreateExtractValue(Val, 0);
4878 Val0 = Builder.CreateZExt(Val0, Int128Ty);
4879 Val1 = Builder.CreateZExt(Val1, Int128Ty);
4882 Val = Builder.CreateShl(Val0, ShiftCst, "shl", true /* nuw */);
4883 Val = Builder.CreateOr(Val, Val1);
4884 return Builder.CreateBitCast(Val, ConvertType(E->getType()));
4893 LoadAddr = Builder.CreateBitCast(LoadAddr, IntResTy->getPointerTo());
4899 Value *Val = Builder.CreateCall(F, LoadAddr, "ldxr");
4902 return Builder.CreateIntToPtr(Val, RealResTy);
4904 Val = Builder.CreateTruncOrBitCast(Val, IntResTy);
4905 return Builder.CreateBitCast(Val, RealResTy);
4919 Tmp = Builder.CreateBitCast(Tmp, llvm::PointerType::getUnqual(STy));
4920 llvm::Value *Val = Builder.CreateLoad(Tmp);
4922 Value *Arg0 = Builder.CreateExtractValue(Val, 0);
4923 Value *Arg1 = Builder.CreateExtractValue(Val, 1);
4924 Value *StPtr = Builder.CreateBitCast(EmitScalarExpr(E->getArg(1)),
4926 return Builder.CreateCall(F, {Arg0, Arg1, StPtr}, "stxp");
4937 StoreAddr = Builder.CreateBitCast(StoreAddr, StoreTy->getPointerTo());
4940 StoreVal = Builder.CreatePtrToInt(StoreVal, Int64Ty);
4942 StoreVal = Builder.CreateBitCast(StoreVal, StoreTy);
4943 StoreVal = Builder.CreateZExtOrBitCast(StoreVal, Int64Ty);
4950 return Builder.CreateCall(F, {StoreVal, StoreAddr}, "stxr");
4955 return Builder.CreateCall(F);
4985 Arg1 = Builder.CreateZExtOrBitCast(Arg1, DataTy);
4987 return Builder.CreateCall(F, {Arg0, Arg1});
5068 Value *Ptr = Builder.CreateBitCast(EmitScalarExpr(E->getArg(0)), Int128PTy);
5069 return Builder.CreateDefaultAlignedLoad(Ptr);
5073 Value *Ptr = Builder.CreateBitCast(Ops[0], Int128PTy);
5074 return Builder.CreateDefaultAlignedStore(EmitScalarExpr(E->getArg(1)), Ptr);
5086 Ops[0] = Builder.CreateBitCast(Ops[0], FTy);
5088 return Builder.CreateFPToUI(Ops[0], InTy);
5089 return Builder.CreateFPToSI(Ops[0], InTy);
5101 Ops[0] = Builder.CreateBitCast(Ops[0], InTy);
5103 return Builder.CreateUIToFP(Ops[0], FTy);
5104 return Builder.CreateSIToFP(Ops[0], FTy);
5110 Vec = Builder.CreateBitCast(Vec, Ty, "v2i64");
5113 Value *Op0 = Builder.CreateExtractElement(Vec, Idx0, "lane0");
5114 Value *Op1 = Builder.CreateExtractElement(Vec, Idx1, "lane1");
5116 return Builder.CreateAdd(Op0, Op1, "vpaddd");
5123 Vec = Builder.CreateBitCast(Vec, Ty, "v2f64");
5126 Value *Op0 = Builder.CreateExtractElement(Vec, Idx0, "lane0");
5127 Value *Op1 = Builder.CreateExtractElement(Vec, Idx1, "lane1");
5129 return Builder.CreateFAdd(Op0, Op1, "vpaddd");
5136 Vec = Builder.CreateBitCast(Vec, Ty, "v2f32");
5139 Value *Op0 = Builder.CreateExtractElement(Vec, Idx0, "lane0");
5140 Value *Op1 = Builder.CreateExtractElement(Vec, Idx1, "lane1");
5142 return Builder.CreateFAdd(Op0, Op1, "vpaddd");
5182 Ops[0] = Builder.CreateBitCast(Ops[0], Int64Ty);
5184 Builder.CreateICmpEQ(Ops[0], llvm::Constant::getNullValue(Int64Ty));
5185 return Builder.CreateSExt(Ops[0], Int64Ty, "vceqzd");
5202 Ops[0] = Builder.CreateBitCast(Ops[0], DoubleTy);
5203 Ops[1] = Builder.CreateBitCast(Ops[1], DoubleTy);
5204 Ops[0] = Builder.CreateFCmp(P, Ops[0], Ops[1]);
5205 return Builder.CreateSExt(Ops[0], Int64Ty, "vcmpd");
5222 Ops[0] = Builder.CreateBitCast(Ops[0], FloatTy);
5223 Ops[1] = Builder.CreateBitCast(Ops[1], FloatTy);
5224 Ops[0] = Builder.CreateFCmp(P, Ops[0], Ops[1]);
5225 return Builder.CreateSExt(Ops[0], Int32Ty, "vcmpd");
5252 Ops[0] = Builder.CreateBitCast(Ops[0], Int64Ty);
5253 Ops[1] = Builder.CreateBitCast(Ops[1], Int64Ty);
5254 Ops[0] = Builder.CreateICmp(P, Ops[0], Ops[1]);
5255 return Builder.CreateSExt(Ops[0], Int64Ty, "vceqd");
5260 Ops[0] = Builder.CreateBitCast(Ops[0], Int64Ty);
5261 Ops[1] = Builder.CreateBitCast(Ops[1], Int64Ty);
5262 Ops[0] = Builder.CreateAnd(Ops[0], Ops[1]);
5263 Ops[0] = Builder.CreateICmp(ICmpInst::ICMP_NE, Ops[0],
5265 return Builder.CreateSExt(Ops[0], Int64Ty, "vtstd");
5278 return Builder.CreateInsertElement(Ops[1], Ops[0], Ops[2], "vset_lane");
5281 Ops[1] = Builder.CreateBitCast(Ops[1],
5284 return Builder.CreateInsertElement(Ops[1], Ops[0], Ops[2], "vset_lane");
5287 Ops[1] = Builder.CreateBitCast(Ops[1],
5290 return Builder.CreateInsertElement(Ops[1], Ops[0], Ops[2], "vset_lane");
5294 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::VectorType::get(Int8Ty, 8));
5295 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5299 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::VectorType::get(Int8Ty, 16));
5300 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5304 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::VectorType::get(Int16Ty, 4));
5305 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5309 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::VectorType::get(Int16Ty, 8));
5310 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5314 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::VectorType::get(Int32Ty, 2));
5315 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5318 Ops[0] = Builder.CreateBitCast(Ops[0],
5320 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5324 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::VectorType::get(Int32Ty, 4));
5325 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5329 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::VectorType::get(Int64Ty, 1));
5330 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5333 Ops[0] = Builder.CreateBitCast(Ops[0],
5335 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5339 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::VectorType::get(Int64Ty, 2));
5340 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5343 Ops[0] = Builder.CreateBitCast(Ops[0],
5345 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5348 Ops[0] = Builder.CreateBitCast(Ops[0],
5350 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5354 Ops[0] = Builder.CreateBitCast(Ops[0],
5356 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5360 Ops[0] = Builder.CreateBitCast(Ops[0],
5362 return Builder.CreateExtractElement(Ops[0], EmitScalarExpr(E->getArg(1)),
5366 return Builder.CreateAdd(Ops[0], EmitScalarExpr(E->getArg(1)), "vaddd");
5369 return Builder.CreateSub(Ops[0], EmitScalarExpr(E->getArg(1)), "vsubd");
5379 Ops[1] = Builder.CreateExtractElement(Ops[1], CI, "lane0");
5388 Ops[1] = Builder.CreateZExt(Ops[1], Int64Ty);
5398 Ops[1] = Builder.CreateZExt(Ops[1], Int64Ty);
5416 Ops[1] = Builder.CreateBitCast(Ops[1], Int64Ty);
5417 Ops.push_back(Builder.CreateNeg(EmitScalarExpr(E->getArg(2))));
5418 Ops[1] = Builder.CreateCall(CGM.getIntrinsic(Int, Int64Ty),
5419 {Ops[1], Builder.CreateSExt(Ops[2], Int64Ty)});
5420 return Builder.CreateAdd(Ops[0], Builder.CreateBitCast(Ops[1], Int64Ty));
5425 return Builder.CreateShl(
5430 return Builder.CreateAShr(
5441 return Builder.CreateLShr(Ops[0], ConstantInt::get(Int64Ty, ShiftAmt),
5446 Ops[1] = Builder.CreateAShr(
5450 return Builder.CreateAdd(Ops[0], Ops[1]);
5459 Ops[1] = Builder.CreateLShr(Ops[1], ConstantInt::get(Int64Ty, ShiftAmt),
5461 return Builder.CreateAdd(Ops[0], Ops[1]);
5467 Ops[2] = Builder.CreateExtractElement(Ops[2], EmitScalarExpr(E->getArg(3)),
5476 Ops[1] = Builder.CreateExtractElement(Ops[1], CI, "lane0");
5503 Ops[2] = Builder.CreateExtractElement(Ops[2], EmitScalarExpr(E->getArg(3)),
5546 Ops[0] = Builder.CreateBitCast(Ops[0], BitTy, "vbsl");
5547 Ops[1] = Builder.CreateBitCast(Ops[1], BitTy, "vbsl");
5548 Ops[2] = Builder.CreateBitCast(Ops[2], BitTy, "vbsl");
5550 Ops[1] = Builder.CreateAnd(Ops[0], Ops[1], "vbsl");
5551 Ops[2] = Builder.CreateAnd(Builder.CreateNot(Ops[0]), Ops[2], "vbsl");
5552 Ops[0] = Builder.CreateOr(Ops[1], Ops[2], "vbsl");
5553 return Builder.CreateBitCast(Ops[0], Ty);
5572 Ops[1] = Builder.CreateBitCast(Ops[1], SourceTy);
5573 Ops[1] = Builder.CreateShuffleVector(Ops[1], Ops[1], SV, "lane");
5583 Ops[0] = Builder.CreateBitCast(Ops[0], DoubleTy);
5584 Ops[1] = Builder.CreateBitCast(Ops[1], DoubleTy);
5587 Ops[2] = Builder.CreateBitCast(Ops[2], VTy);
5588 Ops[2] = Builder.CreateExtractElement(Ops[2], Ops[3], "extract");
5590 Value *Result = Builder.CreateCall(F, {Ops[1], Ops[2], Ops[0]});
5591 return Builder.CreateBitCast(Result, Ty);
5594 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
5595 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
5599 Ops[2] = Builder.CreateBitCast(Ops[2], STy);
5602 Ops[2] = Builder.CreateShuffleVector(Ops[2], Ops[2], SV, "lane");
5604 return Builder.CreateCall(F, {Ops[2], Ops[1], Ops[0]});
5608 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
5609 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
5611 Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
5613 return Builder.CreateCall(F, {Ops[2], Ops[1], Ops[0]});
5622 Ops[2] = Builder.CreateExtractElement(Ops[2], Ops[3], "extract");
5623 return Builder.CreateCall(F, {Ops[1], Ops[2], Ops[0]});
5661 llvm::Value *addend = Builder.CreateBitCast(Ops[0], tmp->getType());
5662 return Builder.CreateAdd(tmp, addend);
5766 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
5768 return usgn ? Builder.CreateUIToFP(Ops[0], Ty, "vcvt")
5769 : Builder.CreateSIToFP(Ops[0], Ty, "vcvt");
5774 Ops[0] = Builder.CreateBitCast(Ops[0], GetNeonType(this, SrcFlag));
5776 return Builder.CreateFPExt(Ops[0], Ty, "vcvt");
5782 Ops[0] = Builder.CreateBitCast(Ops[0], GetNeonType(this, SrcFlag));
5784 return Builder.CreateFPTrunc(Ops[0], Ty, "vcvt");
5794 Ops[0] = Builder.CreateBitCast(Ops[0], GetFloatNeonType(this, Type));
5796 return Builder.CreateFPToUI(Ops[0], Ty);
5797 return Builder.CreateFPToSI(Ops[0], Ty);
5858 Ops[0] = Builder.CreateBitCast(Ops[0], DoubleTy);
5861 Ops[1] = Builder.CreateBitCast(Ops[1], VTy);
5862 Ops[1] = Builder.CreateExtractElement(Ops[1], Ops[2], "extract");
5863 Value *Result = Builder.CreateFMul(Ops[0], Ops[1]);
5864 return Builder.CreateBitCast(Result, Ty);
5867 return Builder.CreateNeg(EmitScalarExpr(E->getArg(0)), "vnegd");
5881 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
5900 return Builder.CreateTrunc(Ops[0], Int8Ty);
5912 return Builder.CreateTrunc(Ops[0], Int16Ty);
5924 return Builder.CreateTrunc(Ops[0], Int8Ty);
5936 return Builder.CreateTrunc(Ops[0], Int16Ty);
5945 return Builder.CreateTrunc(Ops[0], Int8Ty);
5954 return Builder.CreateTrunc(Ops[0], Int16Ty);
5963 return Builder.CreateTrunc(Ops[0], Int8Ty);
5972 return Builder.CreateTrunc(Ops[0], Int16Ty);
5981 return Builder.CreateTrunc(Ops[0], Int8Ty);
5990 return Builder.CreateTrunc(Ops[0], Int16Ty);
5999 return Builder.CreateTrunc(Ops[0], Int8Ty);
6008 return Builder.CreateTrunc(Ops[0], Int16Ty);
6017 return Builder.CreateTrunc(Ops[0], Int8Ty);
6026 return Builder.CreateTrunc(Ops[0], Int16Ty);
6035 return Builder.CreateTrunc(Ops[0], Int8Ty);
6044 return Builder.CreateTrunc(Ops[0], Int16Ty);
6053 return Builder.CreateTrunc(Ops[0], Int8Ty);
6062 return Builder.CreateTrunc(Ops[0], Int16Ty);
6071 return Builder.CreateTrunc(Ops[0], Int8Ty);
6080 return Builder.CreateTrunc(Ops[0], Int16Ty);
6083 Ops[0] = Builder.CreateBitCast(Ops[0], DoubleTy);
6084 Value *RHS = Builder.CreateBitCast(EmitScalarExpr(E->getArg(1)), DoubleTy);
6085 return Builder.CreateFMul(Ops[0], RHS);
6094 return Builder.CreateTrunc(Ops[0], Int16Ty);
6111 return Builder.CreateTrunc(Ops[0], Int16Ty);
6128 return Builder.CreateTrunc(Ops[0], Int16Ty);
6145 return Builder.CreateTrunc(Ops[0], Int16Ty);
6169 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
6171 return Builder.CreateAdd(Ops[0], Ops[1]);
6180 Ops[0] = Builder.CreateBitCast(Ops[0], VTy);
6181 return Builder.CreateAdd(Ops[0], tmp);
6192 Ops[1] = Builder.CreateBitCast(Ops[1], PTy);
6210 Ops[1] = Builder.CreateCall(F, Ops[1], "vld1xN");
6212 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
6213 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
6243 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::PointerType::getUnqual(VTy));
6244 return Builder.CreateDefaultAlignedLoad(Ops[0]);
6247 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::PointerType::getUnqual(VTy));
6248 Ops[1] = Builder.CreateBitCast(Ops[1], VTy);
6249 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
6252 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
6254 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
6255 Ops[0] = Builder.CreateDefaultAlignedLoad(Ops[0]);
6256 return Builder.CreateInsertElement(Ops[1], Ops[0], Ops[2], "vld1_lane");
6261 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
6262 Ops[0] = Builder.CreateDefaultAlignedLoad(Ops[0]);
6264 Ops[0] = Builder.CreateInsertElement(V, Ops[0], CI);
6269 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
6270 Ops[1] = Builder.CreateExtractElement(Ops[1], Ops[2]);
6272 return Builder.CreateDefaultAlignedStore(Ops[1],
6273 Builder.CreateBitCast(Ops[0], Ty));
6277 Ops[1] = Builder.CreateBitCast(Ops[1], PTy);
6280 Ops[1] = Builder.CreateCall(F, Ops[1], "vld2");
6281 Ops[0] = Builder.CreateBitCast(Ops[0],
6283 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
6288 Ops[1] = Builder.CreateBitCast(Ops[1], PTy);
6291 Ops[1] = Builder.CreateCall(F, Ops[1], "vld3");
6292 Ops[0] = Builder.CreateBitCast(Ops[0],
6294 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
6299 Ops[1] = Builder.CreateBitCast(Ops[1], PTy);
6302 Ops[1] = Builder.CreateCall(F, Ops[1], "vld4");
6303 Ops[0] = Builder.CreateBitCast(Ops[0],
6305 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
6311 Ops[1] = Builder.CreateBitCast(Ops[1], PTy);
6314 Ops[1] = Builder.CreateCall(F, Ops[1], "vld2");
6315 Ops[0] = Builder.CreateBitCast(Ops[0],
6317 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
6323 Ops[1] = Builder.CreateBitCast(Ops[1], PTy);
6326 Ops[1] = Builder.CreateCall(F, Ops[1], "vld3");
6327 Ops[0] = Builder.CreateBitCast(Ops[0],
6329 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
6335 Ops[1] = Builder.CreateBitCast(Ops[1], PTy);
6338 Ops[1] = Builder.CreateCall(F, Ops[1], "vld4");
6339 Ops[0] = Builder.CreateBitCast(Ops[0],
6341 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
6349 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
6350 Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
6351 Ops[3] = Builder.CreateZExt(Ops[3], Int64Ty);
6352 Ops[1] = Builder.CreateCall(F, makeArrayRef(Ops).slice(1), "vld2_lane");
6354 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
6355 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
6363 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
6364 Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
6365 Ops[3] = Builder.CreateBitCast(Ops[3], Ty);
6366 Ops[4] = Builder.CreateZExt(Ops[4], Int64Ty);
6367 Ops[1] = Builder.CreateCall(F, makeArrayRef(Ops).slice(1), "vld3_lane");
6369 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
6370 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
6378 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
6379 Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
6380 Ops[3] = Builder.CreateBitCast(Ops[3], Ty);
6381 Ops[4] = Builder.CreateBitCast(Ops[4], Ty);
6382 Ops[5] = Builder.CreateZExt(Ops[5], Int64Ty);
6383 Ops[1] = Builder.CreateCall(F, makeArrayRef(Ops).slice(1), "vld4_lane");
6385 Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
6386 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
6400 Ops[2] = Builder.CreateZExt(Ops[2], Int64Ty);
6417 Ops[3] = Builder.CreateZExt(Ops[3], Int64Ty);
6434 Ops[4] = Builder.CreateZExt(Ops[4], Int64Ty);
6441 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::PointerType::getUnqual(Ty));
6442 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
6443 Ops[2] = Builder
6452 Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ty, Ops[0], vi);
6453 SV = Builder.CreateShuffleVector(Ops[1], Ops[2], Indices, "vtrn");
6454 SV = Builder.CreateDefaultAlignedStore(SV, Addr);
6460 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::PointerType::getUnqual(Ty));
6461 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
6462 Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
6470 Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ty, Ops[0], vi);
6471 SV = Builder.CreateShuffleVector(Ops[1], Ops[2], Indices, "vuzp");
6472 SV = Builder.CreateDefaultAlignedStore(SV, Addr);
6478 Ops[0] = Builder.CreateBitCast(Ops[0], llvm::PointerType::getUnqual(Ty));
6479 Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
6480 Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
6489 Value *Addr = Builder.CreateConstInBoundsGEP1_32(Ty, Ops[0], vi);
6490 SV = Builder.CreateShuffleVector(Ops[1], Ops[2], Indices, "vzip");
6491 SV = Builder.CreateDefaultAlignedStore(SV, Addr);
6561 Result = Builder.CreateInsertElement(Result, Ops[i], Builder.getInt32(i));
6570 llvm::VectorType *MaskTy = llvm::VectorType::get(CGF.Builder.getInt1Ty(),
6572 Value *MaskVec = CGF.Builder.CreateBitCast(Mask, MaskTy);
6580 MaskVec = CGF.Builder.CreateShuffleVector(MaskVec, MaskVec,
6591 Ops[0] = CGF.Builder.CreateBitCast(Ops[0],
6597 return CGF.Builder.CreateAlignedStore(Ops[1], Ops[0], Align);
6602 return CGF.Builder.CreateMaskedStore(Ops[1], Ops[0], Align, MaskVec);
6608 Ops[0] = CGF.Builder.CreateBitCast(Ops[0],
6614 return CGF.Builder.CreateAlignedLoad(Ops[0], Align);
6619 return CGF.Builder.CreateMaskedLoad(Ops[0], Align, MaskVec, Ops[1]);
6632 return CGF.Builder.CreateSelect(Mask, Op0, Op1);
6642 llvm::VectorType::get(CGF.Builder.getInt1Ty(), NumElts));
6645 llvm::VectorType::get(CGF.Builder.getInt1Ty(), NumElts));
6657 Cmp = CGF.Builder.CreateICmp(Pred, Ops[0], Ops[1]);
6662 Cmp = CGF.Builder.CreateAnd(Cmp, getMaskVecValue(CGF, Ops.back(), NumElts));
6670 Cmp = CGF.Builder.CreateShuffleVector(
6673 return CGF.Builder.CreateBitCast(Cmp,
6696 DestAddr = Address(Builder.CreateBitCast(DestAddr.getPointer(), BPP, "cp"),
6698 SrcAddr = Address(Builder.CreateBitCast(SrcAddr.getPointer(), BPP, "ap"),
6701 Value *ArgPtr = Builder.CreateLoad(SrcAddr, "ap.val");
6702 return Builder.CreateStore(ArgPtr, DestAddr);
6737 return Builder.CreateCall(F, Ops);
6746 Value *Cmp = Builder.CreateFCmp(Pred, Ops[0], Ops[1]);
6749 Value *Sext = Builder.CreateSExt(Cmp, IntVecTy);
6750 return Builder.CreateBitCast(Sext, FPVecTy);
6845 Value *CpuFeatures = Builder.CreateGEP(STy, CpuModel, Idxs);
6846 Value *Features = Builder.CreateAlignedLoad(CpuFeatures,
6850 Value *Bitset = Builder.CreateAnd(
6852 return Builder.CreateICmpNE(Bitset, llvm::ConstantInt::get(Int32Ty, 0));
6860 return Builder.CreateCall(F, {Address, RW, Locality, Data});
6869 return Builder.CreateBitCast(BuildVector(Ops),
6872 return Builder.CreateExtractElement(Ops[0],
6876 Builder.CreateStore(Ops[0], Tmp);
6877 return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::x86_sse_ldmxcsr),
6878 Builder.CreateBitCast(Tmp.getPointer(), Int8PtrTy));
6882 Builder.CreateCall(CGM.getIntrinsic(Intrinsic::x86_sse_stmxcsr),
6883 Builder.CreateBitCast(Tmp.getPointer(), Int8PtrTy));
6884 return Builder.CreateLoad(Tmp, "stmxcsr");
6919 Value *Mhi = Builder.CreateTrunc(
6920 Builder.CreateLShr(Ops[1], ConstantInt::get(Int64Ty, 32)), Int32Ty);
6921 Value *Mlo = Builder.CreateTrunc(Ops[1], Int32Ty);
6924 return Builder.CreateCall(CGM.getIntrinsic(ID), Ops);
7004 Ops[1] = Builder.CreateBitCast(Ops[1], VecTy, "cast");
7009 Ops[1] = Builder.CreateExtractElement(Ops[1], Idx, "extract");
7012 Ops[0] = Builder.CreateBitCast(Ops[0], PtrTy);
7013 return Builder.CreateDefaultAlignedStore(Ops[1], Ops[0]);
7049 Value *Align = Builder.CreateShuffleVector(Ops[1], Ops[0],
7063 getLLVMContext(), llvm::ConstantAsMetadata::get(Builder.getInt32(1)));
7066 Value *BC = Builder.CreateBitCast(Ops[0],
7069 StoreInst *SI = Builder.CreateDefaultAlignedStore(Ops[1], BC);
7079 getLLVMContext(), llvm::ConstantAsMetadata::get(Builder.getInt32(1)));
7082 Value *Scl = Builder.CreateExtractElement(Ops[1], (uint64_t)0, "extract");
7085 Value *BC = Builder.CreateBitCast(Ops[0],
7090 StoreInst *SI = Builder.CreateDefaultAlignedStore(Scl, BC);
7180 Builder.CreateCall(F, {Ops[0],Builder.getInt1(false)}),
7191 Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_SGT, Ops[0], Ops[1]);
7192 return Builder.CreateSelect(Cmp, Ops[0], Ops[1]);
7200 Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_UGT, Ops[0], Ops[1]);
7201 return Builder.CreateSelect(Cmp, Ops[0], Ops[1]);
7209 Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_SLT, Ops[0], Ops[1]);
7210 return Builder.CreateSelect(Cmp, Ops[0], Ops[1]);
7218 Value *Cmp = Builder.CreateICmp(ICmpInst::ICMP_ULT, Ops[0], Ops[1]);
7219 return Builder.CreateSelect(Cmp, Ops[0], Ops[1]);
7226 Ops[0] = Builder.CreateBitCast(Ops[0], MMXTy, "cast");
7228 return Builder.CreateCall(F, Ops, "pswapd");
7259 Value *Call = Builder.CreateCall(CGM.getIntrinsic(ID));
7260 Builder.CreateDefaultAlignedStore(Builder.CreateExtractValue(Call, 0),
7262 return Builder.CreateExtractValue(Call, 1);
7329 return Builder.CreateCall(CGM.getIntrinsic(ID), Ops);
7384 return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::readcyclecounter));
7397 Ops[1] = Builder.CreateBitCast(Ops[1], Int8PtrTy);
7399 Ops[0] = Builder.CreateGEP(Ops[1], Ops[0]);
7433 return Builder.CreateCall(F, Ops, "");
7445 Ops[2] = Builder.CreateBitCast(Ops[2], Int8PtrTy);
7446 Ops[1] = Builder.CreateGEP(Ops[2], Ops[1]);
7474 return Builder.CreateCall(F, Ops, "");
7483 return Builder.CreateCall(F, X);
7492 Value *Undef = ConstantInt::get(Builder.getInt1Ty(), false);
7494 return Builder.CreateCall(F, {X, Undef});
7504 return Builder.CreateCall(F, {X, Y});
7535 return Builder.CreateCall(F, X);
7544 return Builder.CreateCall(F, X);
7565 return Builder.CreateCall(F, {X, Y, Z});
7568 return Builder.CreateFSub(Zero,
7569 Builder.CreateCall(F, {X, Y, Z}), "sub");
7572 return Builder.CreateCall(F,
7573 {X, Y, Builder.CreateFSub(Zero, Z, "sub")});
7577 Builder.CreateCall(F, {X, Y, Builder.CreateFSub(Zero, Z, "sub")});
7578 return Builder.CreateFSub(Zero, FsubRes, "sub");
7603 llvm::Value *Tmp = Builder.CreateCall(Callee, {X, Y, Z});
7605 llvm::Value *Result = Builder.CreateExtractValue(Tmp, 0);
7606 llvm::Value *Flag = Builder.CreateExtractValue(Tmp, 1);
7611 llvm::Value *FlagExt = Builder.CreateZExt(Flag, RealFlagType);
7612 Builder.CreateStore(FlagExt, FlagOutPtr);
7624 llvm::Value *Src3ToBool = Builder.CreateIsNotNull(Src3);
7625 return Builder.CreateCall(F, {Src0, Src1, Src2, Src3ToBool});
7718 Value *Call = CGF.Builder.CreateCall(F, Args);
7719 Value *CC = CGF.Builder.CreateExtractValue(Call, 1);
7720 CGF.Builder.CreateStore(CC, CCPtr);
7721 return CGF.Builder.CreateExtractValue(Call, 0);
7731 return Builder.CreateCall(F, {TDB, Control});
7737 return Builder.CreateCall(F, {TDB, Control});
7743 return Builder.CreateCall(F, {TDB, Control});
7748 return Builder.CreateCall(F, Builder.CreateSExt(Data, Int64Ty, "tabort"));
7754 return Builder.CreateCall(F, {Data, Address});
7769 return Builder.CreateCall(F, X);
7778 Value *Undef = ConstantInt::get(Builder.getInt1Ty(), false);
7780 return Builder.CreateCall(F, {X, Undef});
7789 Value *Undef = ConstantInt::get(Builder.getInt1Ty(), false);
7791 return Builder.CreateCall(F, {X, Undef});
7798 return Builder.CreateCall(F, X);
7806 return Builder.CreateCall(F, {X, Y, Z});
7815 return Builder.CreateCall(F, {X, Y, Builder.CreateFSub(Zero, Z, "sub")});
7821 return Builder.CreateCall(F, X);
7828 return Builder.CreateFSub(Zero, Builder.CreateCall(F, X), "sub");
7863 return Builder.CreateCall(F, X);
7868 return Builder.CreateCall(F, {X, M4Value, M5Value});
7956 return Builder.CreateCall(
7959 {Ptr, ConstantInt::get(Builder.getInt32Ty(), Align.getQuantity())});
8027 return Builder.CreateCall(FnALAF32, {Ptr, Val});
8035 return Builder.CreateCall(FnALI32, {Ptr, Val});
8043 return Builder.CreateCall(FnALD32, {Ptr, Val});
8091 return Builder.CreateCall(Callee);
8096 return Builder.CreateCall(Callee, X);