[llvm] 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:13:42 PDT 2018


This causes assertions while building Chromium:
Assertion failed: TSchedModel.hasInstrSchedModelOrItineraries() && "Missing
machine model\n", file
C:\b\c\b\ToTWin\src\third_party\llvm\lib\CodeGen\MachineCombiner.cpp, line
306

This is the -cc1 command line:
../../../../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"

I will prepare a revert.


On Fri, Mar 16, 2018 at 9:08 AM Andrew V. Tischenko via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: avt77
> Date: Fri Mar 16 09:06:24 2018
> New Revision: 327721
>
> URL: http://llvm.org/viewvc/llvm-project?rev=327721&view=rev
> Log:
> This patch fixes the invalid usage of OptSize in Machine Combiner.
> Differential Revision: https://reviews.llvm.org/D43813
>
> 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=327721&r1=327720&r2=327721&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/MachineCombiner.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineCombiner.cpp Fri Mar 16 09:06:24 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 && (NewSize < OldSize))
> -    return true;
> +  if (OptSize)                   // First of all check OptSize option
> +    return (NewSize < OldSize);  // Only substitute if new size < old size
>    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 {
> +      } else if (!OptSize || (NewInstCount <= OldInstCount)) {
>          // 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.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180316/d9fc9a37/attachment.html>


More information about the llvm-commits mailing list