Pick a conservative register class when creating a small live range for remat.
[oota-llvm.git] / lib / CodeGen / InlineSpiller.cpp
index d0c750777f3e12e8607c86ad888995d5f89bcaf1..86f4cfcc92f3b63a787478423c7c383aee877ac0 100644 (file)
@@ -627,7 +627,7 @@ bool InlineSpiller::reMaterializeFor(LiveInterval &VirtReg,
   }
 
   // Alocate a new register for the remat.
-  LiveInterval &NewLI = Edit->createFrom(VirtReg.reg, LIS, VRM);
+  LiveInterval &NewLI = Edit->createFrom(Original, LIS, VRM);
   NewLI.markNotSpillable();
 
   // Finally we can rematerialize OrigMI before MI.