fix a regression introduced by my last patch.
authorChris Lattner <sabre@nondot.org>
Wed, 11 Apr 2007 03:27:24 +0000 (03:27 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 11 Apr 2007 03:27:24 +0000 (03:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35879 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/ScalarReplAggregates.cpp

index 8bc9effde104d6c6894f2fcd1d8f9c353c56895d..ad34012c45fb6880a3306cc62364e52c9f18f825 100644 (file)
@@ -970,20 +970,7 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) {
         if (isa<IntegerType>(LI->getType())) {
           assert(NV->getType() == LI->getType() && "Truncate wasn't enough?");
         } else if (LI->getType()->isFloatingPoint()) {
-          // If needed, truncate the integer to the appropriate size.
-          if (NTy->getBitWidth() > LIBitWidth) {
-            switch (LI->getType()->getTypeID()) {
-            default: assert(0 && "Unknown FP type!");
-            case Type::FloatTyID:
-              NV = new TruncInst(NV, Type::Int32Ty, LI->getName(), LI);
-              break;
-            case Type::DoubleTyID:
-              NV = new TruncInst(NV, Type::Int64Ty, LI->getName(), LI);
-              break;
-            }
-          }
-          
-          // Then do a bitcast.
+          // Just do a bitcast, we know the sizes match up.
           NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI);
         } else {
           // Otherwise must be a pointer.