[X86] Allow x86 call frame optimization to fold more loads into pushes
[oota-llvm.git] / lib / CodeGen / PeepholeOptimizer.cpp
index 3dc73bac5b80af36f08ee80deae4f3fc7d0ade6e..4d5935438068140007d8090d62f979018a63e602 100644 (file)
@@ -1234,9 +1234,9 @@ bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
       if (MI->isDebugValue())
           continue;
 
-      // If there exists an instruction which belongs to the following
-      // categories, we will discard the load candidates.
-      if (MI->mayStore() || MI->isCall() || MI->hasUnmodeledSideEffects())
+      // If we run into an instruction we can't fold across, discard
+      // the load candidates.
+      if (MI->isLoadFoldBarrier())
         FoldAsLoadDefCandidates.clear();
 
       if (MI->isPosition() || MI->isPHI() || MI->isImplicitDef() ||