Bug/case fixes:
(1) select: Ok to convert a pointer to a float or double.
(2) regalloc: Some MachineInstr* for caller-saving code before a call
    were being inserted before and after the call!
(3) Don't insert the caller-saving instructions in the
    MachineCodeForInstruction for the Call instruction.
    *All* instructions generated by register allocation need to be
    recorded in those maps, but it needs to be done uniformly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7051 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/SparcV9/SparcV9InstrSelection.cpp b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
index 6576ef9..086b4a3 100644
--- a/lib/Target/SparcV9/SparcV9InstrSelection.cpp
+++ b/lib/Target/SparcV9/SparcV9InstrSelection.cpp
@@ -477,14 +477,15 @@
       opType == Type::ShortTy || opType == Type::UShortTy ||
       opType == Type::IntTy   || opType == Type::UIntTy)
       opCode = (vopCode == ToFloatTy? V9::FITOS : V9::FITOD);
-  else if (opType == Type::LongTy || opType == Type::ULongTy)
+  else if (opType == Type::LongTy || opType == Type::ULongTy ||
+           isa<PointerType>(opType))
       opCode = (vopCode == ToFloatTy? V9::FXTOS : V9::FXTOD);
   else if (opType == Type::FloatTy)
       opCode = (vopCode == ToFloatTy? V9::INVALID_OPCODE : V9::FSTOD);
   else if (opType == Type::DoubleTy)
       opCode = (vopCode == ToFloatTy? V9::FDTOS : V9::INVALID_OPCODE);
   else
-    assert(0 && "Cannot convert this type to DOUBLE on SPARC");
+    assert(0 && "Trying to convert a non-scalar type to DOUBLE?");
   
   return opCode;
 }