Lines Matching refs:SrcTy

2004   Type* SrcTy = getOperand(0)->getType();  in isLosslessCast()  local
2006 if (SrcTy == DstTy) in isLosslessCast()
2010 if (SrcTy->isPointerTy()) in isLosslessCast()
2024 Type *SrcTy, in isNoopCast() argument
2048 SrcTy->getScalarSizeInBits(); in isNoopCast()
2080 Type *SrcTy, Type *MidTy, Type *DstTy, Type *SrcIntPtrTy, Type *MidIntPtrTy, in isEliminableCastPair() argument
2139 bool chainedBitcast = (SrcTy == DstTy && isFirstBitcast && isSecondBitcast); in isEliminableCastPair()
2142 if ((isFirstBitcast && isa<VectorType>(SrcTy) != isa<VectorType>(MidTy)) || in isEliminableCastPair()
2163 if (!SrcTy->isVectorTy() && DstTy->isIntegerTy()) in isEliminableCastPair()
2175 if (SrcTy->isIntegerTy()) in isEliminableCastPair()
2181 if (SrcTy->isFloatingPointTy()) in isEliminableCastPair()
2186 if (SrcTy->getPointerAddressSpace() != DstTy->getPointerAddressSpace()) in isEliminableCastPair()
2209 unsigned SrcSize = SrcTy->getScalarSizeInBits(); in isEliminableCastPair()
2223 if (SrcTy == DstTy) in isEliminableCastPair()
2231 unsigned SrcSize = SrcTy->getScalarSizeInBits(); in isEliminableCastPair()
2240 if (SrcTy->getPointerAddressSpace() != DstTy->getPointerAddressSpace()) in isEliminableCastPair()
2249 SrcTy->isPtrOrPtrVectorTy() && in isEliminableCastPair()
2252 SrcTy->getPointerAddressSpace() != MidTy->getPointerAddressSpace() && in isEliminableCastPair()
2260 if (SrcTy->getPointerElementType() == DstTy->getPointerElementType()) in isEliminableCastPair()
2269 SrcTy->isIntOrIntVectorTy() && in isEliminableCastPair()
2281 SrcTy->isPtrOrPtrVectorTy() && in isEliminableCastPair()
2284 SrcTy->getPointerAddressSpace() == MidTy->getPointerAddressSpace() && in isEliminableCastPair()
2517 bool CastInst::isCastable(Type *SrcTy, Type *DestTy) { in isCastable() argument
2518 if (!SrcTy->isFirstClassType() || !DestTy->isFirstClassType()) in isCastable()
2521 if (SrcTy == DestTy) in isCastable()
2524 if (VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy)) in isCastable()
2528 SrcTy = SrcVecTy->getElementType(); in isCastable()
2533 unsigned SrcBits = SrcTy->getPrimitiveSizeInBits(); // 0 for ptr in isCastable()
2538 if (SrcTy->isIntegerTy()) // Casting from integral in isCastable()
2540 if (SrcTy->isFloatingPointTy()) // Casting from floating pt in isCastable()
2542 if (SrcTy->isVectorTy()) // Casting from vector in isCastable()
2545 return SrcTy->isPointerTy(); in isCastable()
2548 if (SrcTy->isIntegerTy()) // Casting from integral in isCastable()
2550 if (SrcTy->isFloatingPointTy()) // Casting from floating pt in isCastable()
2552 if (SrcTy->isVectorTy()) // Casting from vector in isCastable()
2560 if (SrcTy->isPointerTy()) // Casting from pointer in isCastable()
2562 return SrcTy->isIntegerTy(); // Casting from integral in isCastable()
2565 if (SrcTy->isVectorTy()) in isCastable()
2572 bool CastInst::isBitCastable(Type *SrcTy, Type *DestTy) { in isBitCastable() argument
2573 if (!SrcTy->isFirstClassType() || !DestTy->isFirstClassType()) in isBitCastable()
2576 if (SrcTy == DestTy) in isBitCastable()
2579 if (VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy)) { in isBitCastable()
2583 SrcTy = SrcVecTy->getElementType(); in isBitCastable()
2590 if (PointerType *SrcPtrTy = dyn_cast<PointerType>(SrcTy)) { in isBitCastable()
2595 unsigned SrcBits = SrcTy->getPrimitiveSizeInBits(); // 0 for ptr in isBitCastable()
2606 if (DestTy->isX86_MMXTy() || SrcTy->isX86_MMXTy()) in isBitCastable()
2612 bool CastInst::isBitOrNoopPointerCastable(Type *SrcTy, Type *DestTy, in isBitOrNoopPointerCastable() argument
2614 if (auto *PtrTy = dyn_cast<PointerType>(SrcTy)) in isBitOrNoopPointerCastable()
2618 if (auto *IntTy = dyn_cast<IntegerType>(SrcTy)) in isBitOrNoopPointerCastable()
2621 return isBitCastable(SrcTy, DestTy); in isBitOrNoopPointerCastable()
2634 Type *SrcTy = Src->getType(); in getCastOpcode() local
2636 assert(SrcTy->isFirstClassType() && DestTy->isFirstClassType() && in getCastOpcode()
2639 if (SrcTy == DestTy) in getCastOpcode()
2643 if (VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy)) in getCastOpcode()
2648 SrcTy = SrcVecTy->getElementType(); in getCastOpcode()
2653 unsigned SrcBits = SrcTy->getPrimitiveSizeInBits(); // 0 for ptr in getCastOpcode()
2658 if (SrcTy->isIntegerTy()) { // Casting from integral in getCastOpcode()
2669 } else if (SrcTy->isFloatingPointTy()) { // Casting from floating pt in getCastOpcode()
2674 } else if (SrcTy->isVectorTy()) { in getCastOpcode()
2679 assert(SrcTy->isPointerTy() && in getCastOpcode()
2684 if (SrcTy->isIntegerTy()) { // Casting from integral in getCastOpcode()
2689 } else if (SrcTy->isFloatingPointTy()) { // Casting from floating pt in getCastOpcode()
2697 } else if (SrcTy->isVectorTy()) { in getCastOpcode()
2708 if (SrcTy->isPointerTy()) { in getCastOpcode()
2709 if (DestTy->getPointerAddressSpace() != SrcTy->getPointerAddressSpace()) in getCastOpcode()
2712 } else if (SrcTy->isIntegerTy()) { in getCastOpcode()
2717 if (SrcTy->isVectorTy()) { in getCastOpcode()
2738 Type *SrcTy = S->getType(); in castIsValid() local
2740 if (!SrcTy->isFirstClassType() || !DstTy->isFirstClassType() || in castIsValid()
2741 SrcTy->isAggregateType() || DstTy->isAggregateType()) in castIsValid()
2745 unsigned SrcBitSize = SrcTy->getScalarSizeInBits(); in castIsValid()
2751 unsigned SrcLength = SrcTy->isVectorTy() ? in castIsValid()
2752 cast<VectorType>(SrcTy)->getNumElements() : 0; in castIsValid()
2760 return SrcTy->isIntOrIntVectorTy() && DstTy->isIntOrIntVectorTy() && in castIsValid()
2763 return SrcTy->isIntOrIntVectorTy() && DstTy->isIntOrIntVectorTy() && in castIsValid()
2766 return SrcTy->isIntOrIntVectorTy() && DstTy->isIntOrIntVectorTy() && in castIsValid()
2769 return SrcTy->isFPOrFPVectorTy() && DstTy->isFPOrFPVectorTy() && in castIsValid()
2772 return SrcTy->isFPOrFPVectorTy() && DstTy->isFPOrFPVectorTy() && in castIsValid()
2776 return SrcTy->isIntOrIntVectorTy() && DstTy->isFPOrFPVectorTy() && in castIsValid()
2780 return SrcTy->isFPOrFPVectorTy() && DstTy->isIntOrIntVectorTy() && in castIsValid()
2783 if (isa<VectorType>(SrcTy) != isa<VectorType>(DstTy)) in castIsValid()
2785 if (VectorType *VT = dyn_cast<VectorType>(SrcTy)) in castIsValid()
2788 return SrcTy->getScalarType()->isPointerTy() && in castIsValid()
2791 if (isa<VectorType>(SrcTy) != isa<VectorType>(DstTy)) in castIsValid()
2793 if (VectorType *VT = dyn_cast<VectorType>(SrcTy)) in castIsValid()
2796 return SrcTy->getScalarType()->isIntegerTy() && in castIsValid()
2799 PointerType *SrcPtrTy = dyn_cast<PointerType>(SrcTy->getScalarType()); in castIsValid()
2810 return SrcTy->getPrimitiveSizeInBits() == DstTy->getPrimitiveSizeInBits(); in castIsValid()
2817 if (VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy)) { in castIsValid()
2827 PointerType *SrcPtrTy = dyn_cast<PointerType>(SrcTy->getScalarType()); in castIsValid()
2838 if (VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy)) { in castIsValid()