Move isLoadFrom/StoreToStackSlot from MRegisterInfo to TargetInstrInfo,a far more logical place.  Other methods should also be moved if anyoneis interested. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25913 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp
index 8a45744..313452d 100644
--- a/lib/CodeGen/VirtRegMap.cpp
+++ b/lib/CodeGen/VirtRegMap.cpp
@@ -490,8 +490,9 @@
       // straight load from the virt reg slot.
       if ((MR & VirtRegMap::isRef) && !(MR & VirtRegMap::isMod)) {
         int FrameIdx;
-        if (unsigned DestReg = MRI->isLoadFromStackSlot(&MI, FrameIdx)) {
-          // If this spill slot is available, insert a copy for it!
+        if (unsigned DestReg = TII->isLoadFromStackSlot(&MI, FrameIdx)) {
+          // If this spill slot is available, turn it into a copy (or nothing)
+          // instead of leaving it as a load!
           std::map<int, unsigned>::iterator It = SpillSlotsAvailable.find(SS);
           if (FrameIdx == SS && It != SpillSlotsAvailable.end()) {
             DEBUG(std::cerr << "Promoted Load To Copy: " << MI);