Int is now compiled to either Int32 or Int64 instead of Word in the stdlib.
Consequently, we get casts from those types to Word arguments that sil
instructions expect.
Adapt the pattern. Also handle other builtin functions along the way.
rdar://19608094
Swift SVN r24798
This reapplies commit r24628 with a fix: use the metatype of a boundgenerictype
to get the substitutions instead of painfully building them ourselves and making
mistakes along the way.
This is not as general as it should be. The general solution is to introduce a
builtin partial_apply_thin_recoverable as John suggested to me in person and
describes in SILGenBuiltin.cpp.
This patch addresses an important subset of problems (ie. sorting an arrays of
things) with low risk for the upcoming release.
radar://19388835
Swift SVN r24657
types.
This is not as general as it should be. The general solution is to introduce
a builtin partial_apply_thin_recoverable as John suggested to me in person and
describes in SILGenBuiltin.cpp.
This patch addresses an important subset of problems (ie. sorting an arrays of
things) with low risk for the upcoming release.
radar://19388835
Swift SVN r24628
1. Eliminate unused variable warnings.
2. Change field names to match capitalization of the rest of the field names in the file.
3. Change method names to match rest of the file.
4. Change get,set method for a field to match the field type.
Swift SVN r24501
If we know at compile-time that a type being casted is conforming to a protocol, then we can replace the checked_cast_addr_br by an unconditional_checked_cast_addr followed by a branch to the success BB of the original checked_cast_addr_br instruction.
If we cannot find at compile-time that a type being casted is conforming to the protocol, but we see that this type is not public, then we know that no new protocol conformance can be added by a different module at run-time. Therefore it is safe to assume that this type does not conform to the protocol and we can replace checked_cast_addr_br by a branch to the failure BB of the original checked_cast_addr_br instruction.
rdar://19487336
Swift SVN r24493
Fixes rdar://problem/19477758
Incidentally I didn't really notice a perforamance impact from this,
probably because the performance inliner was already choosing to inline
these functions.
Swift SVN r24482
This patch improves handling of generic parameters and implements proper handling of metatypes, which were blocking correct devirtualization of inherited and specialized conformances. It enables a corresponding test, because all its blocking issues are resolved now.
Fixes rdar://17823742, rdar://17823746 and rdar://16847192
Swift SVN r23882
When propagating concrete types into witness_method and apply instructions inside propagateExistential, propagate them also inside parameters of polymorphic functions.
Do not refer to init_existential inside apply instructions if we cannot prove that a given init_existential instruction dominates the apply instruction that would refer to it.
Swift SVN r23638
Make the SILCombine logic aware of memory behavior.
This fixes performance issues exposed by copy forwarding.
By itself, there is one confirmed speedup:
StdlibSort +12.3%
Swift SVN r23607
This helps the devirtualizer to replace witness_method by class_method instructions and then devirtualize.
Note: Invocation of protocol methods from generic classes and structs is not supported by this patch yet.
rdar://18857054 and rdar://18506660
Swift SVN r23596
I want to cleanup some code paths in SILCombine and LoadStoreOpts to use
generic create{Addr,Value}Projection methods which create the
appropriate projection instruction for a Projection method. Also this
will allow me to start to hide more of the internal state of Projection.
Swift SVN r23366
This changes the Projection API so that you pass in an instruction and get back
an optional depending on what theinstruction was. This is much cleaner than
always needing to do a switch.
This commit also cleans up the naming in Projection so that we always use the
term "value projection" for struct_extract, tuple_extract, and
unchecked_enum_data instead of the term "extract". This lines up better with the
name we use for the *_addr instructions, "address projection" and avoids
ambiguity since unchecked_enum_data does not have the word "extract" in it.
Additionally by adding in the failable initializers, my centralization of the
initialization logic enables me to ensure that isAddrProjection and
isValueProjection stay in sync with the various constructors via asserts. This
should prevent future bugs if we add additional notions of "projection".
Swift SVN r23356
We used to delete partial_apply with a single strong_release user.
The new array code causes dead partial applys with mulitple
strong_retain/release users. We also want to delete those. Currently, the code
handles the case where all users are retain/releases in the same basic block.
rdar://18840718
Swift SVN r23071
without a valid SILDebugScope. An assertion in IRGenSIL prevents future
optimizations from regressing in this regard.
Introducing SILBuilderWithScope and SILBuilderwithPostprocess to ease the
transition.
This patch is large, but mostly mechanical.
<rdar://problem/18494573> Swift: Debugger is not stopping at the set breakpoint
Swift SVN r22978
Simplify binary switches to select_enum instead of enum_is_tag, and make a first attempt at changing passes over to recognize limited forms of select_enum instead of enum_is_tag. There is one case in test/SILPasses/simplify_cfg.sil I wasn't able to figure out, and there are a lot more general passes we could define in terms of select_enum.
Swift SVN r22615