Commit Graph

214 Commits

Author SHA1 Message Date
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
Andrew Trick
f5f5a9ac2b AddressLowering: Fix indirect concrete existential arguments. 2017-03-28 13:46:28 -07:00
Erik Eckstein
a0079ba5be SIL optimizations: Implement the new API for analysis invalidation.
There are now separate functions for function addition and deletion instead of InvalidationKind::Function.
Also, there is a new function for witness/vtable invalidations.

rdar://problem/29311657
2017-03-14 13:00:54 -07:00
Bob Wilson
9546da3939 Add a missing #include to fix the master-next build.
The AddressLowering.cpp file uses LLVM's CommandLine.h but was not
explicitly including that header. It was implicitly pulled in via other
headers, but LLVM r296846 changed "llvm/ProfileData/InstrProf.h" to
stop including "llvm/IR/Metadata.h" and broke the chain that led to
CommandLine.h.
2017-03-08 16:04:57 -08:00
Andrew Trick
c2b433bad6 Overhaul the AddressLowering pass to optimize projections and handle more cases.
This adds the underpinning for optimizing storage projections. When subobjects are composed in aggregate they no longer require individual copies.

Optimize copy->store sequences.

Added support for enums and existentials.

Added a mini design doc file comment.

Added -optimize-opaque-address-lowering unit tests.
2017-03-07 10:58:09 -08:00
practicalswift
17b6160115 [gardening] Remove unused method replaceValue(..., ...) 2017-03-02 16:19:57 +01:00
Andrew Trick
38d44c2164 AddressLowering: rewrite the call-site lowering logic.
This pass now canonicalizes results before lowering and handles all combinations
of direct and indirect multiple return values. The logic is much less ad-hoc and
more robust.

try_apply still isn't handled, but should be much easier now.

Add visitLoadInst, visitStoreInst, visitDebugValueInst, etc.
2017-02-26 13:52:50 -08:00
practicalswift
33a5601ad1 [gardening] Fix typos 2017-02-23 22:46:40 +01:00
Andrew Trick
4256112150 AddressLowering: fix handling of result tuples. 2017-02-16 11:04:42 -08:00
practicalswift
65b0219f7b [gardening] Fix typos 2017-02-14 20:04:08 +01:00
practicalswift
1c64f04997 [gardening] Fix header inconsistencies 2017-02-14 20:04:05 +01:00
practicalswift
b717bdc0f8 [gardening] Remove unused methods 2017-02-14 09:55:16 +01:00
Andrew Trick
10b118dfa9 [Lowering] Make the AddressLowering pass functional. 2017-02-13 17:10:02 -08:00
Andrew Trick
855918c620 [Lowering] Add an AddressLowering pass. 2017-02-13 17:10:02 -08:00