[llvm] r327733 - Revert r327721 "This patch fixes the invalid usage of OptSize in Machine Combiner."

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 16 13:11:56 PDT 2018


Author: rnk
Date: Fri Mar 16 13:11:55 2018
New Revision: 327733

URL: http://llvm.org/viewvc/llvm-project?rev=327733&view=rev
Log:
Revert r327721 "This patch fixes the invalid usage of OptSize in Machine Combiner."

It causes asserts when compiling Chromium on Win32 with optimizations.
We compile many things with -Os.

Modified:
    llvm/trunk/lib/CodeGen/MachineCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/MachineCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCombiner.cpp?rev=327733&r1=327732&r2=327733&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineCombiner.cpp Fri Mar 16 13:11:55 2018
@@ -407,8 +407,8 @@ bool MachineCombiner::preservesResourceL
 /// \returns true when new instruction sequence should be generated
 /// independent if it lengthens critical path or not
 bool MachineCombiner::doSubstitute(unsigned NewSize, unsigned OldSize) {
-  if (OptSize)                   // First of all check OptSize option
-    return (NewSize < OldSize);  // Only substitute if new size < old size
+  if (OptSize && (NewSize < OldSize))
+    return true;
   if (!TSchedModel.hasInstrSchedModelOrItineraries())
     return true;
   return false;
@@ -588,7 +588,7 @@ bool MachineCombiner::combineInstruction
         // Eagerly stop after the first pattern fires.
         Changed = true;
         break;
-      } else if (!OptSize || (NewInstCount <= OldInstCount)) {
+      } else {
         // For big basic blocks, we only compute the full trace the first time
         // we hit this. We do not invalidate the trace, but instead update the
         // instruction depths incrementally.




More information about the llvm-commits mailing list