Commit Graph

12 Commits

Author SHA1 Message Date
practicalswift
5e255e07d7 [gardening] Remove redundant logic 2017-04-11 23:04:55 +02:00
Andrew Trick
be1881aa1f Remove redundant Transform.getName() definitions.
At some point, pass definitions were heavily macro-ized. Pass
descriptive names were added in two places. This is not only redundant
but a source of confusion. You could waste a lot of time grepping for
the wrong string. I removed all the getName() overrides which, at
around 90 passes, was a fairly significant amount of code bloat.

Any pass that we want to be able to invoke by name from a tool
(sil-opt) or pipeline plan *should* have unique type name, enum value,
commend-line string, and name string. I removed a comment about the
various inliner passes that contradicted that.

Side note: We should be consistent with the policy that a pass is
identified by its type. We have a couple passes, LICM and CSE, which
currently violate that convention.
2017-04-09 15:20:28 -07:00
Hugh Bellamy
397f25e43b Use LLVM_ATTRIBUTE_NOINLINE instead of __attribute__((noinline)) 2017-01-14 12:46:14 +00:00
Arnold Schwaighofer
d6dd8e83bc Hack to workaround a clang lto bug
We hit an assert in AllocStackHoisting that is only triggered in a release lto
build.

Clang forwards the read of parent basic block of 'AssignedLoc' in the next
statement:

  auto *EntryBB = AssignedLoc->getFunction()->getEntryBlock(); // read AssignedLoc->ParentBB
  AssignedLoc->removeFromParent(); // writes AssignedLoc->ParentBB

To this read:

  EntryBB->push_front(AssignedLoc); // read AssignedLoc->ParentBB and assert if non-null, *should reload*

As a temporary workaround outline code to prevent the miscompile.

rdar://29982182
2017-01-13 08:42:02 -08:00
practicalswift
adc75d6806 [gardening] Add "// end anonymous namespace" where appropriate 2017-01-07 20:18:21 +01:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift
9c738f6b58 Merge pull request #6438 from practicalswift/i-heard-you-like-partitions
[gardening] Fix partiion^H^H^H^H^Hitions^H^H^H^H^H^Htitions.
2016-12-22 15:18:36 +01:00
practicalswift
fe3b9968fc [gardening] Fix partiion^H^H^H^H^Hitions^H^H^H^H^H^Htitions.
By being less creative in the ways we spell "partition" :-)
2016-12-21 21:36:24 +01:00
practicalswift
f05a338e9a [gardening] Prefer (!foo) to (foo == false). Fix typo. 2016-12-21 21:25:58 +01:00
Arnold Schwaighofer
9a2582f7a4 Remove to strict assert
unreachable exits don't need an dealloc_stack and so there can be alloc_stack
instructions without a matching dealloc_stack
2016-12-20 17:02:26 -08:00
Arnold Schwaighofer
a87f34372e Rename SILFunction::entryBB to getEntryBlock 2016-12-20 07:51:55 -08:00
Arnold Schwaighofer
f1c2dcf1fa Add an alloc_stack hoisting pass.
Hoist alloc_stack instructions of 'generic' or resilient type to the entry
block. At the same time also perform a very simple stack coloring analysis.
This does not use a true liveness-analysis yet but rather employs some simple
conservative checks to see whether the live ranges of two alloc_stacks might
interfere.

AllocStackHoisting is an IRGen SIL pass. This allows for using IRGen's type
lowering information. Furthermore, hoisting and merging the alloc_stack
instructions this late does not interfere with SIL optimizations because the
resulting SIL never gets serialized.
2016-12-20 07:51:55 -08:00