[X86] Call frame optimization - allow stack-relative movs to be folded into a push
[oota-llvm.git] / lib / Target / X86 / X86CallFrameOptimization.cpp
index c0c009b6b7a3ac0c2795afe1d6553af7b430d449..1ede5c73f2b493495a0a9184926bb80f296e7a4b 100644 (file)
@@ -469,12 +469,6 @@ MachineInstr *X86CallFrameOptimization::canFoldIntoRegPush(
       DefMI->getParent() != FrameSetup->getParent())
     return nullptr;
 
-  // Be careful with movs that load from a stack slot, since it may get
-  // resolved incorrectly.
-  // TODO: Again, we already have the infrastructure, so this should work.
-  if (!DefMI->getOperand(1).isReg())
-    return nullptr;
-
   // Now, make sure everything else up until the ADJCALLSTACK is a sequence
   // of MOVs. To be less conservative would require duplicating a lot of the
   // logic from PeepholeOptimizer.