Lines Matching refs:SV
926 ConvertScalar_InsertValue(Value *SV, Value *Old, in ConvertScalar_InsertValue() argument
935 uint64_t ValSize = TD.getTypeAllocSizeInBits(SV->getType()); in ConvertScalar_InsertValue()
945 SV->getType()->getPrimitiveSizeInBits()) in ConvertScalar_InsertValue()
946 return Builder.CreateBitCast(SV, AllocaType, "tmp"); in ConvertScalar_InsertValue()
948 return CreateShuffleVectorCast(SV, VTy, Builder); in ConvertScalar_InsertValue()
952 assert(!(SV->getType()->isVectorTy() && Offset != 0) && "Can't insert a " in ConvertScalar_InsertValue()
955 Type *CastElementTy = getScaledElementType(VTy, SV->getType(), in ConvertScalar_InsertValue()
959 LLVMContext &Context = SV->getContext(); in ConvertScalar_InsertValue()
964 Value *SVCast = Builder.CreateBitCast(SV, CastElementTy, "tmp"); in ConvertScalar_InsertValue()
976 assert(SV->getType() == VTy->getElementType()); in ConvertScalar_InsertValue()
979 return Builder.CreateInsertElement(Old, SV, in ConvertScalar_InsertValue()
980 ConstantInt::get(Type::getInt32Ty(SV->getContext()), Elt), in ConvertScalar_InsertValue()
985 if (StructType *ST = dyn_cast<StructType>(SV->getType())) { in ConvertScalar_InsertValue()
988 Value *Elt = Builder.CreateExtractValue(SV, i, "tmp"); in ConvertScalar_InsertValue()
996 if (ArrayType *AT = dyn_cast<ArrayType>(SV->getType())) { in ConvertScalar_InsertValue()
999 Value *Elt = Builder.CreateExtractValue(SV, i, "tmp"); in ConvertScalar_InsertValue()
1007 unsigned SrcWidth = TD.getTypeSizeInBits(SV->getType()); in ConvertScalar_InsertValue()
1009 unsigned SrcStoreWidth = TD.getTypeStoreSizeInBits(SV->getType()); in ConvertScalar_InsertValue()
1011 if (SV->getType()->isFloatingPointTy() || SV->getType()->isVectorTy()) in ConvertScalar_InsertValue()
1012 SV = Builder.CreateBitCast(SV, in ConvertScalar_InsertValue()
1013 IntegerType::get(SV->getContext(),SrcWidth), "tmp"); in ConvertScalar_InsertValue()
1014 else if (SV->getType()->isPointerTy()) in ConvertScalar_InsertValue()
1015 SV = Builder.CreatePtrToInt(SV, TD.getIntPtrType(SV->getContext()), "tmp"); in ConvertScalar_InsertValue()
1018 if (SV->getType() != AllocaType) { in ConvertScalar_InsertValue()
1019 if (SV->getType()->getPrimitiveSizeInBits() < in ConvertScalar_InsertValue()
1021 SV = Builder.CreateZExt(SV, AllocaType, "tmp"); in ConvertScalar_InsertValue()
1025 SV = Builder.CreateTrunc(SV, AllocaType, "tmp"); in ConvertScalar_InsertValue()
1048 SV = Builder.CreateShl(SV, ConstantInt::get(SV->getType(), in ConvertScalar_InsertValue()
1052 SV = Builder.CreateLShr(SV, ConstantInt::get(SV->getType(), in ConvertScalar_InsertValue()
1062 SV = Builder.CreateOr(Old, SV, "ins"); in ConvertScalar_InsertValue()
1064 return SV; in ConvertScalar_InsertValue()