/freebsd/contrib/llvm-project/llvm/lib/Transforms/InstCombine/ |
H A D | InstCombineCasts.cpp | 217 auto *DestTy = dyn_cast<FixedVectorType>(Ty); in commonCastTransforms() local 218 if (SrcTy && DestTy && in commonCastTransforms() 219 SrcTy->getNumElements() == DestTy->getNumElements() && in commonCastTransforms() 220 SrcTy->getPrimitiveSizeInBits() == DestTy->getPrimitiveSizeInBits()) { in commonCastTransforms() 221 Value *CastX = Builder.CreateCast(CI.getOpcode(), X, DestTy); in commonCastTransforms() 448 Type *DestTy = Trunc.getType(); in narrowFunnelShift() local 449 unsigned NarrowWidth = DestTy->getScalarSizeInBits(); in narrowFunnelShift() 531 Value *NarrowShAmt = Builder.CreateZExtOrTrunc(ShAmt, DestTy); in narrowFunnelShift() 534 X = Y = Builder.CreateTrunc(ShVal0, DestTy); in narrowFunnelShift() 536 Y = Builder.CreateTrunc(ShVal1, DestTy); in narrowFunnelShift() [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/Analysis/ |
H A D | InstSimplifyFolder.h | 116 Type *DestTy) const override { in FoldCast() argument 117 return simplifyCastInst(Op, V, DestTy, SQ); in FoldCast() 130 Value *CreatePointerCast(Constant *C, Type *DestTy) const override { in CreatePointerCast() argument 131 if (C->getType() == DestTy) in CreatePointerCast() 133 return ConstFolder.CreatePointerCast(C, DestTy); in CreatePointerCast() 137 Type *DestTy) const override { in CreatePointerBitCastOrAddrSpaceCast() argument 138 if (C->getType() == DestTy) in CreatePointerBitCastOrAddrSpaceCast() 140 return ConstFolder.CreatePointerBitCastOrAddrSpaceCast(C, DestTy); in CreatePointerBitCastOrAddrSpaceCast()
|
H A D | TargetFolder.h | 185 Type *DestTy) const override { in FoldCast() argument 187 return ConstantFoldCastOperand(Op, C, DestTy, DL); in FoldCast() 204 Constant *CreatePointerCast(Constant *C, Type *DestTy) const override { in CreatePointerCast() argument 205 if (C->getType() == DestTy) in CreatePointerCast() 207 return Fold(ConstantExpr::getPointerCast(C, DestTy)); in CreatePointerCast() 211 Type *DestTy) const override { in CreatePointerBitCastOrAddrSpaceCast() argument 212 if (C->getType() == DestTy) in CreatePointerBitCastOrAddrSpaceCast() 214 return Fold(ConstantExpr::getPointerBitCastOrAddrSpaceCast(C, DestTy)); in CreatePointerBitCastOrAddrSpaceCast()
|
H A D | ConstantFolding.h | 127 Constant *ConstantFoldCastOperand(unsigned Opcode, Constant *C, Type *DestTy, 132 Constant *ConstantFoldIntegerCast(Constant *C, Type *DestTy, bool IsSigned, 211 Constant *ConstantFoldLoadThroughBitcast(Constant *C, Type *DestTy,
|
/freebsd/contrib/llvm-project/llvm/tools/llvm-stress/ |
H A D | llvm-stress.cpp | 545 Type *DestTy = pickScalarType(); in Act() local 549 DestTy = pickVectorType(cast<VectorType>(VTy)); in Act() 552 if (VTy == DestTy) return; in Act() 556 if (!DestTy->isPointerTy()) in Act() 557 DestTy = PointerType::get(DestTy, 0); in Act() 559 new BitCastInst(V, DestTy, "PC", BB->getTerminator())); in Act() 563 unsigned DestSize = DestTy->getScalarType()->getPrimitiveSizeInBits(); in Act() 568 new BitCastInst(V, DestTy, "BC", BB->getTerminator())); in Act() 572 if (VTy->isIntOrIntVectorTy() && DestTy->isIntOrIntVectorTy()) { in Act() 575 new TruncInst(V, DestTy, "Tr", BB->getTerminator())); in Act() [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/IR/ |
H A D | IRBuilder.h | 2012 Value *CreateTrunc(Value *V, Type *DestTy, const Twine &Name = "", 2014 if (V->getType() == DestTy) 2016 if (Value *Folded = Folder.FoldCast(Instruction::Trunc, V, DestTy)) 2018 Instruction *I = CastInst::Create(Instruction::Trunc, V, DestTy); 2026 Value *CreateZExt(Value *V, Type *DestTy, const Twine &Name = "", 2028 if (V->getType() == DestTy) 2030 if (Value *Folded = Folder.FoldCast(Instruction::ZExt, V, DestTy)) 2032 Instruction *I = Insert(new ZExtInst(V, DestTy), Name); 2038 Value *CreateSExt(Value *V, Type *DestTy, const Twine &Name = "") { 2039 return CreateCast(Instruction::SExt, V, DestTy, Name); [all …]
|
H A D | NoFolder.h | 111 Type *DestTy) const override { in FoldCast() argument 124 Instruction *CreatePointerCast(Constant *C, Type *DestTy) const override { in CreatePointerCast() argument 125 return CastInst::CreatePointerCast(C, DestTy); in CreatePointerCast() 129 Constant *C, Type *DestTy) const override { in CreatePointerBitCastOrAddrSpaceCast() argument 130 return CastInst::CreatePointerBitCastOrAddrSpaceCast(C, DestTy); in CreatePointerBitCastOrAddrSpaceCast()
|
H A D | ConstantFolder.h | 174 Type *DestTy) const override { in FoldCast() argument 177 return ConstantExpr::getCast(Op, C, DestTy); in FoldCast() 178 return ConstantFoldCastInstruction(Op, C, DestTy); in FoldCast() 193 Constant *CreatePointerCast(Constant *C, Type *DestTy) const override { in CreatePointerCast() argument 194 return ConstantExpr::getPointerCast(C, DestTy); in CreatePointerCast() 198 Type *DestTy) const override { in CreatePointerBitCastOrAddrSpaceCast() argument 199 return ConstantExpr::getPointerBitCastOrAddrSpaceCast(C, DestTy); in CreatePointerBitCastOrAddrSpaceCast()
|
H A D | IRBuilderFolder.h | 75 Type *DestTy) const = 0; 85 virtual Value *CreatePointerCast(Constant *C, Type *DestTy) const = 0; 87 Type *DestTy) const = 0;
|
H A D | AutoUpgrade.h | 80 Instruction *UpgradeBitCastInst(unsigned Opc, Value *V, Type *DestTy, 86 Constant *UpgradeBitCastExpr(unsigned Opc, Constant *C, Type *DestTy);
|
H A D | ConstantFold.h | 37 Type *DestTy ///< The destination type
|
/freebsd/contrib/llvm-project/llvm/lib/IR/ |
H A D | ConstantFold.cpp | 70 static Constant *FoldBitCast(Constant *V, Type *DestTy) { in FoldBitCast() argument 72 if (SrcTy == DestTy) in FoldBitCast() 77 if (VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) { in FoldBitCast() 79 return Constant::getAllOnesValue(DestTy); in FoldBitCast() 92 if (DestTy->isFloatingPointTy() && !DestTy->isPPC_FP128Ty()) in FoldBitCast() 93 return ConstantFP::get(DestTy->getContext(), in FoldBitCast() 94 APFloat(DestTy->getFltSemantics(), in FoldBitCast() 113 if (!DestTy->isIntegerTy()) in FoldBitCast() 124 Type *DestTy) { in foldMaybeUndesirableCast() argument 126 ? ConstantExpr::getCast(opc, V, DestTy) in foldMaybeUndesirableCast() [all …]
|
H A D | Core.cpp | 4071 LLVMTypeRef DestTy, const char *Name) { in LLVMBuildTrunc() argument 4072 return wrap(unwrap(B)->CreateTrunc(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildTrunc() 4076 LLVMTypeRef DestTy, const char *Name) { in LLVMBuildZExt() argument 4077 return wrap(unwrap(B)->CreateZExt(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildZExt() 4081 LLVMTypeRef DestTy, const char *Name) { in LLVMBuildSExt() argument 4082 return wrap(unwrap(B)->CreateSExt(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildSExt() 4086 LLVMTypeRef DestTy, const char *Name) { in LLVMBuildFPToUI() argument 4087 return wrap(unwrap(B)->CreateFPToUI(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildFPToUI() 4091 LLVMTypeRef DestTy, const char *Name) { in LLVMBuildFPToSI() argument 4092 return wrap(unwrap(B)->CreateFPToSI(unwrap(Val), unwrap(DestTy), Name)); in LLVMBuildFPToSI() [all …]
|
H A D | Verifier.cpp | 3213 Type *DestTy = I.getType(); in visitTruncInst() local 3217 unsigned DestBitSize = DestTy->getScalarSizeInBits(); in visitTruncInst() 3220 Check(DestTy->isIntOrIntVectorTy(), "Trunc only produces integer", &I); in visitTruncInst() 3221 Check(SrcTy->isVectorTy() == DestTy->isVectorTy(), in visitTruncInst() 3231 Type *DestTy = I.getType(); in visitZExtInst() local 3235 Check(DestTy->isIntOrIntVectorTy(), "ZExt only produces an integer", &I); in visitZExtInst() 3236 Check(SrcTy->isVectorTy() == DestTy->isVectorTy(), in visitZExtInst() 3239 unsigned DestBitSize = DestTy->getScalarSizeInBits(); in visitZExtInst() 3249 Type *DestTy = I.getType(); in visitSExtInst() local 3253 unsigned DestBitSize = DestTy->getScalarSizeInBits(); in visitSExtInst() [all …]
|
H A D | Instructions.cpp | 2719 Type *DestTy, in isNoopCast() argument 2721 assert(castIsValid(Opcode, SrcTy, DestTy) && "method precondition"); in isNoopCast() 2740 DestTy->getScalarSizeInBits(); in isNoopCast() 2742 return DL.getIntPtrType(DestTy)->getScalarSizeInBits() == in isNoopCast() 3085 bool CastInst::isBitCastable(Type *SrcTy, Type *DestTy) { in isBitCastable() argument 3086 if (!SrcTy->isFirstClassType() || !DestTy->isFirstClassType()) in isBitCastable() 3089 if (SrcTy == DestTy) in isBitCastable() 3093 if (VectorType *DestVecTy = dyn_cast<VectorType>(DestTy)) { in isBitCastable() 3097 DestTy = DestVecTy->getElementType(); in isBitCastable() 3102 if (PointerType *DestPtrTy = dyn_cast<PointerType>(DestTy)) { in isBitCastable() [all …]
|
/freebsd/contrib/llvm-project/llvm/utils/TableGen/ |
H A D | CallingConvEmitter.cpp | 300 Record *DestTy = Action->getValueAsDef("DestTy"); in EmitAction() local 301 MVT::SimpleValueType DestVT = getValueType(DestTy); in EmitAction() 314 Record *DestTy = Action->getValueAsDef("DestTy"); in EmitAction() local 315 MVT::SimpleValueType DestVT = getValueType(DestTy); in EmitAction() 330 Record *DestTy = Action->getValueAsDef("DestTy"); in EmitAction() local 331 O << IndentStr << "LocVT = " << getEnumName(getValueType(DestTy)) in EmitAction() 335 Record *DestTy = Action->getValueAsDef("DestTy"); in EmitAction() local 336 O << IndentStr << "LocVT = " << getEnumName(getValueType(DestTy)) in EmitAction() 340 Record *DestTy = Action->getValueAsDef("DestTy"); in EmitAction() local 341 O << IndentStr << "LocVT = " << getEnumName(getValueType(DestTy)) in EmitAction()
|
/freebsd/contrib/llvm-project/llvm/include/llvm/CodeGen/GlobalISel/ |
H A D | LegalizationArtifactCombiner.h | 428 const LLT DestTy = MRI.getType(MI.getOperand(0).getReg()); in tryFoldUnmergeCast() local 432 const unsigned DestSize = DestTy.getSizeInBits(); in tryFoldUnmergeCast() 435 if (SrcTy.isVector() && SrcTy.getScalarType() == DestTy.getScalarType()) { in tryFoldUnmergeCast() 446 DestTy.isVector() ? CastSrcTy.getNumElements() / NumDefs : 1; in tryFoldUnmergeCast() 471 if (CastSrcTy.isScalar() && SrcTy.isScalar() && !DestTy.isVector()) { in tryFoldUnmergeCast() 484 {TargetOpcode::G_UNMERGE_VALUES, {DestTy, CastSrcTy}})) in tryFoldUnmergeCast() 495 DstRegs[Idx] = MRI.createGenericVirtualRegister(DestTy); in tryFoldUnmergeCast() 512 LLT OpTy, LLT DestTy) { in canFoldMergeOpcode() argument 543 return !DestTy.isVector() && OpTy.isVector() && in canFoldMergeOpcode() 544 DestTy == OpTy.getElementType(); in canFoldMergeOpcode() [all …]
|
/freebsd/contrib/llvm-project/clang/lib/CodeGen/ |
H A D | TargetInfo.cpp | 135 LangAS DestAddr, llvm::Type *DestTy, bool isNonNull) const { in performAddrSpaceCast() argument 139 return performAddrSpaceCast(CGF.CGM, C, SrcAddr, DestAddr, DestTy); in performAddrSpaceCast() 142 Src, DestTy, Src->hasName() ? Src->getName() + ".ascast" : ""); in performAddrSpaceCast() 148 llvm::Type *DestTy) const { in performAddrSpaceCast() 151 return llvm::ConstantExpr::getPointerCast(Src, DestTy); in performAddrSpaceCast()
|
H A D | CGExprScalar.cpp | 2224 QualType DestTy = CE->getType(); in VisitCastExpr() local 2243 Addr = Addr.withElementType(CGF.ConvertTypeForMem(DestTy)); in VisitCastExpr() 2244 LValue LV = CGF.MakeAddrLValue(Addr, DestTy); in VisitCastExpr() 2251 SourceLVal.getAddress().withElementType(CGF.ConvertTypeForMem(DestTy)); in VisitCastExpr() 2252 LValue DestLV = CGF.MakeAddrLValue(Addr, DestTy); in VisitCastExpr() 2263 llvm::Type *DstTy = ConvertType(DestTy); in VisitCastExpr() 2270 if (auto *PT = DestTy->getAs<PointerType>()) { in VisitCastExpr() 2285 if (SrcType.mayBeNotDynamicClass() && DestTy.mayBeDynamicClass()) { in VisitCastExpr() 2289 } else if (SrcType.mayBeDynamicClass() && DestTy.mayBeNotDynamicClass()) { in VisitCastExpr() 2304 QualType PointeeType = DestTy->getPointeeType(); in VisitCastExpr() [all …]
|
H A D | TargetInfo.h | 302 llvm::Type *DestTy, 313 LangAS DestAddr, llvm::Type *DestTy, 324 llvm::Type *DestTy) const;
|
/freebsd/contrib/llvm-project/llvm/lib/Analysis/ |
H A D | ConstantFolding.cpp | 71 static Constant *foldConstVectorToAPInt(APInt &Result, Type *DestTy, in foldConstVectorToAPInt() argument 92 return ConstantExpr::getBitCast(C, DestTy); in foldConstVectorToAPInt() 104 Constant *FoldBitCast(Constant *C, Type *DestTy, const DataLayout &DL) { in FoldBitCast() argument 105 assert(CastInst::castIsValid(Instruction::BitCast, C, DestTy) && in FoldBitCast() 109 if (Constant *Res = ConstantFoldLoadFromUniformValue(C, DestTy, DL)) in FoldBitCast() 114 if (isa<IntegerType>(DestTy) || DestTy->isFloatingPointTy()) { in FoldBitCast() 128 APInt Result(DL.getTypeSizeInBits(DestTy), 0); in FoldBitCast() 129 if (Constant *CE = foldConstVectorToAPInt(Result, DestTy, C, in FoldBitCast() 133 if (isa<IntegerType>(DestTy)) in FoldBitCast() 134 return ConstantInt::get(DestTy, Result); in FoldBitCast() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/IPO/ |
H A D | MergeFunctions.cpp | 489 static Value *createCast(IRBuilder<> &Builder, Value *V, Type *DestTy) { in createCast() argument 492 assert(DestTy->isStructTy()); in createCast() 493 assert(SrcTy->getStructNumElements() == DestTy->getStructNumElements()); in createCast() 494 Value *Result = PoisonValue::get(DestTy); in createCast() 498 DestTy->getStructElementType(I)); in createCast() 504 assert(!DestTy->isStructTy()); in createCast() 505 if (SrcTy->isIntegerTy() && DestTy->isPointerTy()) in createCast() 506 return Builder.CreateIntToPtr(V, DestTy); in createCast() 507 else if (SrcTy->isPointerTy() && DestTy->isIntegerTy()) in createCast() 508 return Builder.CreatePtrToInt(V, DestTy); in createCast() [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm-c/ |
H A D | Core.h | 4479 LLVMTypeRef DestTy, const char *Name); 4481 LLVMTypeRef DestTy, const char *Name); 4483 LLVMTypeRef DestTy, const char *Name); 4485 LLVMTypeRef DestTy, const char *Name); 4487 LLVMTypeRef DestTy, const char *Name); 4489 LLVMTypeRef DestTy, const char *Name); 4491 LLVMTypeRef DestTy, const char *Name); 4493 LLVMTypeRef DestTy, const char *Name); 4495 LLVMTypeRef DestTy, const char *Name); 4497 LLVMTypeRef DestTy, const char *Name); [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/Target/ |
H A D | TargetCallingConv.td | 164 ValueType DestTy = destTy; 170 ValueType DestTy = destTy; 176 ValueType DestTy = destTy; 182 ValueType DestTy = destTy; 188 ValueType DestTy = destTy;
|
/freebsd/contrib/llvm-project/llvm/lib/Target/Hexagon/ |
H A D | HexagonLoopIdiomRecognition.cpp | 592 void promoteTo(Instruction *In, IntegerType *DestTy, BasicBlock *LoopB); 975 IntegerType *DestTy) { in isPromotableTo() argument 977 if (!T || T->getBitWidth() > DestTy->getBitWidth()) in isPromotableTo() 979 if (T->getBitWidth() == DestTy->getBitWidth()) in isPromotableTo() 1013 IntegerType *DestTy, BasicBlock *LoopB) { in promoteTo() argument 1019 In->mutateType(DestTy); in promoteTo() 1020 unsigned DestBW = DestTy->getBitWidth(); in promoteTo() 1036 InV = IRBuilder<>(InB->getTerminator()).CreateZExt(InV, DestTy); in promoteTo() 1049 Value *Mask = ConstantInt::get(DestTy, (1u << TruncTy->getBitWidth()) - 1); in promoteTo() 1060 In->setOperand(i, ConstantInt::get(DestTy, CI->getZExtValue())); in promoteTo() [all …]
|