diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-07-30 21:11:17 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-07-30 21:11:17 +0000 |
commit | 0de6832c16ce48f6546c74f6b17e27d149eebfb2 (patch) | |
tree | 2492e75a6f596e9629cc7f9fd768ada080aac4d1 /lib/IR/Instructions.cpp | |
parent | 36850ad779cb77930ab9e03bc1bde4ad47dc9dce (diff) | |
download | external_llvm-0de6832c16ce48f6546c74f6b17e27d149eebfb2.zip external_llvm-0de6832c16ce48f6546c74f6b17e27d149eebfb2.tar.gz external_llvm-0de6832c16ce48f6546c74f6b17e27d149eebfb2.tar.bz2 |
Remove isCastable since nothing uses it now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/Instructions.cpp')
-rw-r--r-- | lib/IR/Instructions.cpp | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/lib/IR/Instructions.cpp b/lib/IR/Instructions.cpp index 665fe66..f2c6691 100644 --- a/lib/IR/Instructions.cpp +++ b/lib/IR/Instructions.cpp @@ -2454,69 +2454,6 @@ CastInst *CastInst::CreateFPCast(Value *C, Type *Ty, return Create(opcode, C, Ty, Name, InsertAtEnd); } -// Check whether it is valid to call getCastOpcode for these types. -// This routine must be kept in sync with getCastOpcode. -bool CastInst::isCastable(Type *SrcTy, Type *DestTy) { - if (!SrcTy->isFirstClassType() || !DestTy->isFirstClassType()) - return false; - - if (SrcTy == DestTy) - return true; - - if (VectorType *SrcVecTy = dyn_cast<VectorType>(SrcTy)) - if (VectorType *DestVecTy = dyn_cast<VectorType>(DestTy)) - if (SrcVecTy->getNumElements() == DestVecTy->getNumElements()) { - // An element by element cast. Valid if casting the elements is valid. - SrcTy = SrcVecTy->getElementType(); - DestTy = DestVecTy->getElementType(); - } - - // Get the bit sizes, we'll need these - unsigned SrcBits = SrcTy->getPrimitiveSizeInBits(); // 0 for ptr - unsigned DestBits = DestTy->getPrimitiveSizeInBits(); // 0 for ptr - - // Run through the possibilities ... - if (DestTy->isIntegerTy()) { // Casting to integral - if (SrcTy->isIntegerTy()) { // Casting from integral - return true; - } else if (SrcTy->isFloatingPointTy()) { // Casting from floating pt - return true; - } else if (SrcTy->isVectorTy()) { // Casting from vector - return DestBits == SrcBits; - } else { // Casting from something else - return SrcTy->isPointerTy(); - } - } else if (DestTy->isFloatingPointTy()) { // Casting to floating pt - if (SrcTy->isIntegerTy()) { // Casting from integral - return true; - } else if (SrcTy->isFloatingPointTy()) { // Casting from floating pt - return true; - } else if (SrcTy->isVectorTy()) { // Casting from vector - return DestBits == SrcBits; - } else { // Casting from something else - return false; - } - } else if (DestTy->isVectorTy()) { // Casting to vector - return DestBits == SrcBits; - } else if (DestTy->isPointerTy()) { // Casting to pointer - if (SrcTy->isPointerTy()) { // Casting from pointer - return true; - } else if (SrcTy->isIntegerTy()) { // Casting from integral - return true; - } else { // Casting from something else - return false; - } - } else if (DestTy->isX86_MMXTy()) { - if (SrcTy->isVectorTy()) { - return DestBits == SrcBits; // 64-bit vector to MMX - } else { - return false; - } - } else { // Casting to something else - return false; - } -} - bool CastInst::isBitCastable(Type *SrcTy, Type *DestTy) { if (!SrcTy->isFirstClassType() || !DestTy->isFirstClassType()) return false; |