[dmd-internals] [D-Programming-Language/dmd] 6c14fa: fix Issue 14431 - huge slowdown of compilation spe...

GitHub via dmd-internals dmd-internals at puremagic.com
Tue Sep 1 21:10:11 PDT 2015


  Branch: refs/heads/master
  Home:   https://github.com/D-Programming-Language/dmd
  Commit: 6c14fadca403a61a578795ec0fb71f9340c7b543
      https://github.com/D-Programming-Language/dmd/commit/6c14fadca403a61a578795ec0fb71f9340c7b543
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-08-25 (Tue, 25 Aug 2015)

  Changed paths:
    M src/struct.c
    M src/template.c
    M src/template.h
    M test/runnable/extra-files/test14198.d
    M test/runnable/link14198b.sh

  Log Message:
  -----------
  fix Issue 14431 - huge slowdown of compilation speed

In the pull request #4384, all instance has been changed to invoke
semantic3(). It was for the link-failure issue in specific case, but it
was too excessive.

1. Semantic analysis strategy for template instances:
  We cannot determine which instance does not need to be placed in object
file until semantic analysis completed. Therefore, for all templates
instantiated in root module, compiler should invoke their semantic3 --
regardless of whether those are also instantiated in non-root module. If
a template is _only_ instantiated in non-root module, we can elide its
semantic3 (and for the compilation speed we should do that).

2. Code generation strategy for template instances:
  If a template is instantiated in non-root module, compiler usually does
not have to put it in object file. But if a template is instantiated in
both of root and non-root modules which mutually import each other, it
needs to placed in objfile.


  Commit: 5b464f3393980a0229c079ff6e646ef843681996
      https://github.com/D-Programming-Language/dmd/commit/5b464f3393980a0229c079ff6e646ef843681996
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-08-25 (Tue, 25 Aug 2015)

  Changed paths:
    A test/runnable/imports/test14901a.d
    A test/runnable/imports/test14901b.d
    A test/runnable/imports/test14901c.d
    A test/runnable/imports/test14901d.d
    A test/runnable/test14901.d

  Log Message:
  -----------
  fix Issue 14901 - template static shared this() run multiple times with separate compilation


  Commit: 7cced26789de95e2e14c1452c7334d50f68f9deb
      https://github.com/D-Programming-Language/dmd/commit/7cced26789de95e2e14c1452c7334d50f68f9deb
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-08-28 (Fri, 28 Aug 2015)

  Changed paths:
    M src/template.c

  Log Message:
  -----------
  (will be squashed later) Better appendToModuleMember implementation and update comments


  Commit: a587c3d6a49c198822a0629071c401e62d592787
      https://github.com/D-Programming-Language/dmd/commit/a587c3d6a49c198822a0629071c401e62d592787
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-08-28 (Fri, 28 Aug 2015)

  Changed paths:
    M src/template.c
    A test/runnable/extra-files/linkdebug.d
    A test/runnable/extra-files/linkdebug_primitives.d
    A test/runnable/extra-files/linkdebug_range.d
    A test/runnable/extra-files/linkdebug_uni.d
    A test/runnable/linkdebug.sh

  Log Message:
  -----------
  Prefer instantiations from root modules when -debug/-unittest is specified


  Commit: cf56e5ad84164276f31f1d567ded97738a42191d
      https://github.com/D-Programming-Language/dmd/commit/cf56e5ad84164276f31f1d567ded97738a42191d
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-08-28 (Fri, 28 Aug 2015)

  Changed paths:
    M src/aggregate.h
    M src/expression.c
    M src/magicport.json
    M src/struct.c
    M src/toobj.c
    M src/typinf.c

  Log Message:
  -----------
  Elide codegen if TypeInfo is speculative

Even if a struct is defined as non-root symbol, some built-in operations
request its TypeInfo. For those, today TypeInfo_Struct is generated in COMDAT.

On the other hand, TypeInfoDeclaration is always generated when the TypeInfo is requested,
even if the code exists in speculative scope. By that, some unneeded
TypeInfo objects had excessively generated.
If a TypeInfo is not actually used, we should stop its generation.

To satisfy two requirements, I added "speculative TypeInfo" concept
associated with template instances.

By this change, when a TypeInfo is *requested*, the codegen pass still
visit it always. But if the corresponding type is instantiated struct or
its derived, and is definitely speculative, the TypeInfo code also won't
be emit into object file.


  Commit: 0b45d187c8ddb7442e4f7a9fc8780bb1ac58dbbc
      https://github.com/D-Programming-Language/dmd/commit/0b45d187c8ddb7442e4f7a9fc8780bb1ac58dbbc
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-08-28 (Fri, 28 Aug 2015)

  Changed paths:
    M src/inline.c
    M src/struct.c

  Log Message:
  -----------
  More TypeInfo objects would be requested from inlined functions

1. When a non-root function is succeeded to expand for inlining,
the additional TypeInfo requests should be handled properly.

2. When a function's semantic3 pass will get called from `canInline`, it
would generate more speculative instances when -debug/-unittest is specified.
If the additionally instantiated function succeeds to expand, it should be
changed to non-speculative, because its code is reachable from the final executable.


  Commit: cd29d5f34cbacebd83ecdb9727ab1b93f7fa6af1
      https://github.com/D-Programming-Language/dmd/commit/cd29d5f34cbacebd83ecdb9727ab1b93f7fa6af1
  Author: Rainer Schuetze <r.sagitario at gmx.de>
  Date:   2015-08-28 (Fri, 28 Aug 2015)

  Changed paths:
    M src/template.c
    A test/runnable/imports/link14541traits.d
    A test/runnable/link14541.d

  Log Message:
  -----------
  Merge pull request #4814 from 9rnsr/fix14541

Issue 14541 - "duplicate COMDAT" linker error with the template forward reference in Tuple.opAssign


  Commit: 922d79a43ff60ed324e32e2f4be1430de209746f
      https://github.com/D-Programming-Language/dmd/commit/922d79a43ff60ed324e32e2f4be1430de209746f
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-08-29 (Sat, 29 Aug 2015)

  Changed paths:
    M src/declaration.c
    M src/expression.c
    A test/compilable/ice12554.d
    A test/compilable/test14781.d
    R test/fail_compilation/fail9148.d
    R test/fail_compilation/ice12554.d

  Log Message:
  -----------
  fix Issue 14781 - impure delegate to pure function context should be able to modify context


  Commit: 0c9f5a272bf47e1ad81d2a8a4c56adfd3461fde7
      https://github.com/D-Programming-Language/dmd/commit/0c9f5a272bf47e1ad81d2a8a4c56adfd3461fde7
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-08-29 (Sat, 29 Aug 2015)

  Changed paths:
    A test/compilable/test14962.d

  Log Message:
  -----------
  fix Issue 14962 - compiler inference of attributes for nested map seems broken

It has been revealed since the commit/PR:

f22d9dbb42b6a32d5b4c7c9f3db45e07c9f8aaf6
https://github.com/D-Programming-Language/dmd/pull/4464

By the fix, some attribute inference order bug for template functions had
been fixed - when foo() calls bar!(), and bar!() calls baz!(), the bar!()
attribute should be inferred after the attrs of baz!() determined.

And then, compiler infers the purity of nested two lambdas in the 14962
test case, and the case has been rejected by the 14781 behavior.


  Commit: 083ea4a15049a25c4837d4720173d7b609d27916
      https://github.com/D-Programming-Language/dmd/commit/083ea4a15049a25c4837d4720173d7b609d27916
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-08-30 (Sun, 30 Aug 2015)

  Changed paths:
    M src/typinf.c

  Log Message:
  -----------
  Fix isSpeculativeType logic


  Commit: b30556bf2ce1b4e49fdba51ea759725c2fc6e48f
      https://github.com/D-Programming-Language/dmd/commit/b30556bf2ce1b4e49fdba51ea759725c2fc6e48f
  Author: Martin Nowak <code at dawg.eu>
  Date:   2015-08-30 (Sun, 30 Aug 2015)

  Changed paths:
    M src/declaration.c
    M src/expression.c
    A test/compilable/ice12554.d
    A test/compilable/test14781.d
    A test/compilable/test14962.d
    R test/fail_compilation/fail9148.d
    R test/fail_compilation/ice12554.d

  Log Message:
  -----------
  Merge pull request #4970 from 9rnsr/fix14781

[REG2.067/2.068] Issue 14781 & 14962 - fix problematic purity inference introduced in #3626


  Commit: 92fcc9da72e2889406031a34d9a5d22b075f7d50
      https://github.com/D-Programming-Language/dmd/commit/92fcc9da72e2889406031a34d9a5d22b075f7d50
  Author: Martin Nowak <code at dawg.eu>
  Date:   2015-08-30 (Sun, 30 Aug 2015)

  Changed paths:
    M src/aggregate.h
    M src/expression.c
    M src/inline.c
    M src/magicport.json
    M src/struct.c
    M src/template.c
    M src/template.h
    M src/toobj.c
    M src/typinf.c
    A test/runnable/extra-files/linkdebug.d
    A test/runnable/extra-files/linkdebug_primitives.d
    A test/runnable/extra-files/linkdebug_range.d
    A test/runnable/extra-files/linkdebug_uni.d
    M test/runnable/extra-files/test14198.d
    A test/runnable/imports/link14541traits.d
    A test/runnable/imports/test14901a.d
    A test/runnable/imports/test14901b.d
    A test/runnable/imports/test14901c.d
    A test/runnable/imports/test14901d.d
    M test/runnable/link14198b.sh
    A test/runnable/link14541.d
    A test/runnable/linkdebug.sh
    A test/runnable/test14901.d

  Log Message:
  -----------
  Merge pull request #4944 from 9rnsr/fix14431

[REG 2.067.0] Issue 14431 - huge slowdown of compilation speed


  Commit: 7946344223863e67493695247d38cbb03db82cd6
      https://github.com/D-Programming-Language/dmd/commit/7946344223863e67493695247d38cbb03db82cd6
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-08-31 (Mon, 31 Aug 2015)

  Changed paths:
    M src/typinf.c
    A test/runnable/imports/linktypeinfo_file.d
    A test/runnable/linktypeinfo.d

  Log Message:
  -----------
  fix Issue 14985 - Link failure for const TypeInfo of speculative instantiated struct


  Commit: ce8e6d13cc82a8c9c175d4db9967f29dbd0d96e7
      https://github.com/D-Programming-Language/dmd/commit/ce8e6d13cc82a8c9c175d4db9967f29dbd0d96e7
  Author: Daniel Murphy <yebblies at gmail.com>
  Date:   2015-08-31 (Mon, 31 Aug 2015)

  Changed paths:
    M src/typinf.c
    A test/runnable/imports/linktypeinfo_file.d
    A test/runnable/linktypeinfo.d

  Log Message:
  -----------
  Merge pull request #4995 from 9rnsr/fix14985

[REG2.068.1-b1] Issue 14985 - Link failure for const TypeInfo of speculative instantiated struct


  Commit: 0f50f12dfda9064723ed1d78fe0e724687fff150
      https://github.com/D-Programming-Language/dmd/commit/0f50f12dfda9064723ed1d78fe0e724687fff150
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-08-31 (Mon, 31 Aug 2015)

  Changed paths:
    M src/mtype.c
    M test/compilable/b1215.d

  Log Message:
  -----------
  fix Issue 14986 - Assertion failed: (id->dyncast() == DYNCAST_DSYMBOL)


  Commit: fa02c617d58e9dc73afbef83f41ae041287e3ba9
      https://github.com/D-Programming-Language/dmd/commit/fa02c617d58e9dc73afbef83f41ae041287e3ba9
  Author: Walter Bright <walter at walterbright.com>
  Date:   2015-08-31 (Mon, 31 Aug 2015)

  Changed paths:
    M src/mtype.c
    M test/compilable/b1215.d

  Log Message:
  -----------
  Merge pull request #5004 from 9rnsr/fix14986

[REG2.068.1-b2] Issue 14986 - Assertion failed: (id->dyncast() == DYNCAST_DSYMBOL)


  Commit: efd23ee18576135b3bb13ec359fe6edd792c587b
      https://github.com/D-Programming-Language/dmd/commit/efd23ee18576135b3bb13ec359fe6edd792c587b
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-09-02 (Wed, 02 Sep 2015)

  Changed paths:
    M src/aggregate.h
    M src/aliasthis.c
    M src/arrayop.c
    M src/cppmangle.c
    M src/declaration.c
    M src/dsymbol.c
    M src/dsymbol.h
    M src/expression.c
    M src/expression.h
    M src/func.c
    M src/inline.c
    M src/magicport.json
    M src/mtype.c
    M src/mtype.h
    M src/nogc.c
    M src/opover.c
    M src/parse.c
    M src/parse.h
    M src/statement.c
    M src/struct.c
    M src/template.c
    M src/template.h
    M src/toobj.c
    M src/typinf.c
    M test/compilable/b1215.d
    A test/compilable/ice12554.d
    A test/compilable/test14781.d
    A test/compilable/test14962.d
    A test/compilable/test14973.d
    M test/fail_compilation/diag9831.d
    R test/fail_compilation/fail1.d
    M test/fail_compilation/fail11545.d
    M test/fail_compilation/fail120.d
    R test/fail_compilation/fail2.d
    M test/fail_compilation/fail39.d
    M test/fail_compilation/fail9.d
    R test/fail_compilation/fail9148.d
    A test/fail_compilation/fail_opover.d
    R test/fail_compilation/ice12554.d
    A test/fail_compilation/ice14621.d
    A test/fail_compilation/ice14923.d
    A test/fail_compilation/ice14929.d
    M test/fail_compilation/ice9865.d
    A test/runnable/extra-files/linkdebug.d
    A test/runnable/extra-files/linkdebug_primitives.d
    A test/runnable/extra-files/linkdebug_range.d
    A test/runnable/extra-files/linkdebug_uni.d
    M test/runnable/extra-files/test14198.d
    A test/runnable/imports/linktypeinfo_file.d
    A test/runnable/imports/test14901a.d
    A test/runnable/imports/test14901b.d
    A test/runnable/imports/test14901c.d
    A test/runnable/imports/test14901d.d
    M test/runnable/link14198b.sh
    A test/runnable/linkdebug.sh
    A test/runnable/linktypeinfo.d
    M test/runnable/opover2.d
    A test/runnable/test14901.d

  Log Message:
  -----------
  Merge remote-tracking branch 'upstream/stable' into merge_stable_convert

Conflicts:
	src/opover.c


  Commit: 469b6d2df98f3be9f18c4b2d17766f577c9ccb05
      https://github.com/D-Programming-Language/dmd/commit/469b6d2df98f3be9f18c4b2d17766f577c9ccb05
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-09-02 (Wed, 02 Sep 2015)

  Changed paths:
    R src/access.c
    A src/access.d
    A src/aggregate.d
    R src/aliasthis.c
    A src/aliasthis.d
    R src/apply.c
    A src/apply.d
    R src/argtypes.c
    A src/argtypes.d
    R src/arrayop.c
    A src/arrayop.d
    A src/arraytypes.d
    R src/attrib.c
    A src/attrib.d
    R src/builtin.c
    A src/builtin.d
    R src/canthrow.c
    A src/canthrow.d
    R src/cast.c
    R src/class.c
    R src/clone.c
    A src/clone.d
    R src/cond.c
    A src/cond.d
    R src/constfold.c
    A src/constfold.d
    R src/cppmangle.c
    A src/cppmangle.d
    R src/ctfeexpr.c
    A src/ctfeexpr.d
    A src/dcast.d
    A src/dclass.d
    R src/declaration.c
    A src/declaration.d
    R src/delegatize.c
    A src/delegatize.d
    A src/denum.d
    A src/dimport.d
    A src/dinifile.d
    A src/dinterpret.d
    A src/dmacro.d
    A src/dmangle.d
    A src/dmodule.d
    R src/doc.c
    A src/doc.d
    A src/dscope.d
    A src/dstruct.d
    R src/dsymbol.c
    A src/dsymbol.d
    A src/dtemplate.d
    A src/dunittest.d
    A src/dversion.d
    R src/entity.c
    R src/enum.c
    R src/errors.c
    A src/errors.d
    R src/escape.c
    A src/escape.d
    R src/expression.c
    A src/expression.d
    R src/func.c
    A src/func.d
    R src/globals.c
    A src/globals.d
    R src/hdrgen.c
    A src/hdrgen.d
    R src/identifier.c
    A src/identifier.d
    R src/imphint.c
    A src/imphint.d
    R src/import.c
    R src/inifile.c
    R src/init.c
    A src/init.d
    R src/inline.c
    A src/inline.d
    R src/interpret.c
    R src/intrange.c
    R src/json.c
    A src/json.d
    R src/lexer.c
    A src/lexer.d
    A src/lib.d
    R src/link.c
    A src/link.d
    R src/macro.c
    R src/mangle.c
    R src/mars.c
    A src/mars.d
    R src/module.c
    R src/mtype.c
    A src/mtype.d
    R src/nogc.c
    A src/nogc.d
    R src/nspace.c
    A src/nspace.d
    R src/objc.c
    A src/objc.d
    R src/objc_stubs.c
    R src/opover.c
    A src/opover.d
    R src/optimize.c
    A src/optimize.d
    R src/parse.c
    A src/parse.d
    R src/root/aav.c
    A src/root/aav.d
    R src/root/async.c
    R src/root/async.h
    R src/root/checkedint.c
    R src/root/checkedint.h
    R src/root/file.c
    A src/root/file.d
    R src/root/filename.c
    A src/root/filename.d
    R src/root/longdouble.c
    R src/root/man.c
    A src/root/man.d
    R src/root/object.c
    R src/root/outbuffer.c
    A src/root/outbuffer.d
    R src/root/port.c
    R src/root/response.c
    A src/root/response.d
    R src/root/rmem.c
    R src/root/speller.c
    A src/root/speller.d
    R src/root/stringtable.c
    A src/root/stringtable.d
    R src/sapply.c
    A src/sapply.d
    R src/scope.c
    R src/sideeffect.c
    A src/sideeffect.d
    R src/statement.c
    A src/statement.d
    R src/staticassert.c
    A src/staticassert.d
    R src/struct.c
    R src/target.c
    A src/target.d
    R src/template.c
    R src/tokens.c
    A src/tokens.d
    R src/traits.c
    A src/traits.d
    R src/unittests.c
    R src/utf.c
    A src/utf.d
    R src/version.c
    A src/visitor.d

  Log Message:
  -----------
  convert C++ -> D


  Commit: 2d86d820810858058ab6c22f3c9cd226d0b80df1
      https://github.com/D-Programming-Language/dmd/commit/2d86d820810858058ab6c22f3c9cd226d0b80df1
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2015-09-02 (Wed, 02 Sep 2015)

  Changed paths:
    M src/aggregate.h
    M src/declaration.d
    M src/dstruct.d
    M src/dtemplate.d
    M src/expression.d
    M src/inline.d
    M src/mtype.d
    M src/template.h
    M src/todt.c
    M src/toobj.c
    M src/typinf.d
    M test/compilable/b1215.d
    A test/compilable/ice12554.d
    A test/compilable/test14781.d
    A test/compilable/test14962.d
    R test/fail_compilation/fail9148.d
    R test/fail_compilation/ice12554.d
    A test/runnable/extra-files/linkdebug.d
    A test/runnable/extra-files/linkdebug_primitives.d
    A test/runnable/extra-files/linkdebug_range.d
    A test/runnable/extra-files/linkdebug_uni.d
    M test/runnable/extra-files/test14198.d
    A test/runnable/imports/linktypeinfo_file.d
    A test/runnable/imports/test14901a.d
    A test/runnable/imports/test14901b.d
    A test/runnable/imports/test14901c.d
    A test/runnable/imports/test14901d.d
    M test/runnable/link14198b.sh
    A test/runnable/linkdebug.sh
    A test/runnable/linktypeinfo.d
    A test/runnable/test14901.d

  Log Message:
  -----------
  Merge branch 'merge_stable_convert' into merge_stable

Conflicts:
	src/access.d
	src/aggregate.d
	src/aliasthis.d
	src/apply.d
	src/argtypes.d
	src/arrayop.d
	src/arraytypes.d
	src/attrib.d
	src/builtin.d
	src/canthrow.d
	src/clone.d
	src/cond.d
	src/constfold.d
	src/cppmangle.d
	src/ctfeexpr.d
	src/dcast.d
	src/dclass.d
	src/declaration.d
	src/delegatize.d
	src/denum.d
	src/dimport.d
	src/dinterpret.d
	src/dmacro.d
	src/dmangle.d
	src/dmodule.d
	src/doc.d
	src/dscope.d
	src/dstruct.d
	src/dsymbol.d
	src/dtemplate.d
	src/dversion.d
	src/errors.d
	src/escape.d
	src/expression.d
	src/func.d
	src/globals.d
	src/hdrgen.d
	src/identifier.d
	src/init.d
	src/inline.d
	src/json.d
	src/lexer.d
	src/lib.d
	src/link.d
	src/magicport.json
	src/mars.d
	src/mtype.d
	src/nogc.d
	src/nspace.d
	src/objc.d
	src/opover.d
	src/optimize.d
	src/parse.d
	src/root/file.d
	src/root/man.d
	src/root/outbuffer.d
	src/sapply.d
	src/sideeffect.d
	src/statement.d
	src/staticassert.d
	src/target.d
	src/tokens.d
	src/traits.d
	src/typinf.c
	src/visitor.d


  Commit: d44cda0ccaf157ca8a22e9683939ad55c30632b5
      https://github.com/D-Programming-Language/dmd/commit/d44cda0ccaf157ca8a22e9683939ad55c30632b5
  Author: Hara Kenji <k.hara.pg+dev at gmail.com>
  Date:   2015-09-02 (Wed, 02 Sep 2015)

  Changed paths:
    M src/aggregate.h
    M src/declaration.d
    M src/dstruct.d
    M src/dtemplate.d
    M src/expression.d
    M src/inline.d
    M src/mtype.d
    M src/template.h
    M src/todt.c
    M src/toobj.c
    M src/typinf.d
    M test/compilable/b1215.d
    A test/compilable/ice12554.d
    A test/compilable/test14781.d
    A test/compilable/test14962.d
    R test/fail_compilation/fail9148.d
    R test/fail_compilation/ice12554.d
    A test/runnable/extra-files/linkdebug.d
    A test/runnable/extra-files/linkdebug_primitives.d
    A test/runnable/extra-files/linkdebug_range.d
    A test/runnable/extra-files/linkdebug_uni.d
    M test/runnable/extra-files/test14198.d
    A test/runnable/imports/linktypeinfo_file.d
    A test/runnable/imports/test14901a.d
    A test/runnable/imports/test14901b.d
    A test/runnable/imports/test14901c.d
    A test/runnable/imports/test14901d.d
    M test/runnable/link14198b.sh
    A test/runnable/linkdebug.sh
    A test/runnable/linktypeinfo.d
    A test/runnable/test14901.d

  Log Message:
  -----------
  Merge pull request #5019 from 9rnsr/merge_stable

Merge branch 'merge_stable_convert' into merge_stable


Compare: https://github.com/D-Programming-Language/dmd/compare/ef811cf0e76f...d44cda0ccaf1


More information about the dmd-internals mailing list