<div dir="ltr">This causes assertions while building Chromium:<div><div>Assertion failed: TSchedModel.hasInstrSchedModelOrItineraries() && "Missing machine model\n", file C:\b\c\b\ToTWin\src\third_party\llvm\lib\CodeGen\MachineCombiner.cpp, line 306</div></div><div><br></div><div>This is the -cc1 command line:</div><div>../../../../llvm-project/build/bin/clang-cl.exe /nologo /showIncludes  "-imsvcc:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\1180cb75833ea365097e279efb2d5d7a42dee4b0\win_sdk\bin\..\..\win_sdk\include\10.0.15063.0\um" "-imsvcc:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\1180cb75833ea365097e279efb2d5d7a42dee4b0\win_sdk\bin\..\..\win_sdk\include\10.0.15063.0\shared" "-imsvcc:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\1180cb75833ea365097e279efb2d5d7a42dee4b0\win_sdk\bin\..\..\win_sdk\include\10.0.15063.0\winrt" "-imsvcc:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\1180cb75833ea365097e279efb2d5d7a42dee4b0\win_sdk\bin\..\..\win_sdk\include\10.0.15063.0\ucrt" "-imsvcc:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\1180cb75833ea365097e279efb2d5d7a42dee4b0\win_sdk\bin\..\..\vc\tools\msvc\14.11.25503\include" "-imsvcc:\src\chromium\src\third_party\depot_tools\win_toolchain\vs_files\1180cb75833ea365097e279efb2d5d7a42dee4b0\win_sdk\bin\..\..\vc\tools\msvc\14.11.25503\atlmfc\include" -DU_I18N_IMPLEMENTATION -DV8_DEPRECATION_WARNINGS -DUSE_AURA=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -D_HAS_EXCEPTIONS=0 -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -DDEPRECATEDENUMERATOR(x)=[[deprecated(x)]] -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=1 -DWIN32 -D_SECURE_ATL -D_USING_V110_SDK71_ -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDDI_VERSION=0x0A000002 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_DLOPEN=0 -DUCONFIG_ONLY_HTML_CONVERSION=1 -DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=wchar_t -I../.. -Igen -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -fcolor-diagnostics -Xclang -mllvm -Xclang -instcombine-lower-dbg-declare=0 /Gy /FS /bigobj /d2FastFail /Zc:sizedDealloc- -fmsc-version=1911 -m32 /Brepro /O1 /Ob2 /Oy- /Zc:inline /Gw /Oi /Z7 -fno-standalone-debug /MT -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare /W3 /wd4800 /wd4267 /wd4996 -Wno-unused-variable /WX /utf-8 /wd4091 /wd4127 /wd4251 /wd4275 /wd4312 /wd4324 /wd4351 /wd4355 /wd4503 /wd4589 /wd4611 /wd4100 /wd4121 /wd4244 /wd4505 /wd4510 /wd4512 /wd4610 /wd4838 /wd4995 /wd4996 /wd4456 /wd4457 /wd4458 /wd4459 /wd4267 -Wno-unknown-pragmas -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-enum-compare-switch -Wno-null-pointer-arithmetic /wd4005 /wd4068 /wd4267 /wd4333 /utf-8 -Wno-parentheses -Wno-unused-function -Wno-deprecated-declarations /TP /GR /wd4577 /c ../../third_party/icu/source/i18n/calendar.cpp /Foobj/third_party/icu/icui18n/calendar.obj /Fd"obj/third_party/icu/icui18n_cc.pdb"<br></div><div><br></div><div>I will prepare a revert.</div></div><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Mar 16, 2018 at 9:08 AM Andrew V. Tischenko via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: avt77<br>
Date: Fri Mar 16 09:06:24 2018<br>
New Revision: 327721<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=327721&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=327721&view=rev</a><br>
Log:<br>
This patch fixes the invalid usage of OptSize in Machine Combiner.<br>
Differential Revision: <a href="https://reviews.llvm.org/D43813" rel="noreferrer" target="_blank">https://reviews.llvm.org/D43813</a><br>
<br>
Modified:<br>
    llvm/trunk/lib/CodeGen/MachineCombiner.cpp<br>
<br>
Modified: llvm/trunk/lib/CodeGen/MachineCombiner.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCombiner.cpp?rev=327721&r1=327720&r2=327721&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineCombiner.cpp?rev=327721&r1=327720&r2=327721&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/MachineCombiner.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/MachineCombiner.cpp Fri Mar 16 09:06:24 2018<br>
@@ -407,8 +407,8 @@ bool MachineCombiner::preservesResourceL<br>
 /// \returns true when new instruction sequence should be generated<br>
 /// independent if it lengthens critical path or not<br>
 bool MachineCombiner::doSubstitute(unsigned NewSize, unsigned OldSize) {<br>
-  if (OptSize && (NewSize < OldSize))<br>
-    return true;<br>
+  if (OptSize)                   // First of all check OptSize option<br>
+    return (NewSize < OldSize);  // Only substitute if new size < old size<br>
   if (!TSchedModel.hasInstrSchedModelOrItineraries())<br>
     return true;<br>
   return false;<br>
@@ -588,7 +588,7 @@ bool MachineCombiner::combineInstruction<br>
         // Eagerly stop after the first pattern fires.<br>
         Changed = true;<br>
         break;<br>
-      } else {<br>
+      } else if (!OptSize || (NewInstCount <= OldInstCount)) {<br>
         // For big basic blocks, we only compute the full trace the first time<br>
         // we hit this. We do not invalidate the trace, but instead update the<br>
         // instruction depths incrementally.<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>