Now that the ARC optimizer does not rely on stripCasts I also added
unchecked_trivial_bit_cast to stripCasts.
This and r21164 give the following speedups > 10%:
Ary 55.95%
MatMul 36.71%
Ary2 34.97%
Richard 32.08%
PrimeNum 15.87%
<rdar://problem/17456455>
Swift SVN r21240
This mostly falls out from the metatype cast infrastructure, but we need to generalize some Sema and SILGen code to accept AnyMetatypeType. Concrete-to-existential metatypes will need more runtime checking that isn't implemented, so raise a 'not implemented' error on those for now.
Swift SVN r17798
This should eliminate pointless operations that get added to our inline
cost itinerary.
rdar://15567647
rdar://16762768
rdar://16832529
Swift SVN r17644
We want to generally treat blocks as heap objects until proven stack-able by escape analysis, like we do generally with other heap entities. The only place we should be exposed to stack blocks is when they're passed as arguments, so handle this by copy_block'ing any block arguments we get in the function prolog. Optimization can eliminate them when analysis shows the block doesn't escape or is already on the heap.
Swift SVN r16096
Previously we only supported SILArguments. In the process of changing this I
noticed that our densemap implementation for SILValues only hashes the wrapped
ValueBase instead of hash combining that hash with a hash of the result number.
The main use case for this is to enable the insertion of a Builtin.trap + RAUW
SILUndef of uses of an unconditional_checked_cast that is invalid after
specialization.
rdar://16490450
Swift SVN r15747
This method looks recursively through the operand chain of the given SILValue
until it finds a non-object projection instruction. It then returns that value.
An object projection instruction is one of:
1. struct_extract.
2. tuple_extract.
Swift SVN r12918
An address projection instruction is one of the following instructions:
1. struct_element_addr.
2. tuple_element_addr.
3. ref_element_addr.
This method takes in the given SILValue and continually searches up its
operand chain until it finds a non address projection, non-cast
value (where cast is defined as in SILValue::stripCasts()). The found
SILValue is then returned.
Swift SVN r12909
This method takes in a SILValue and returns the SILValue created by continually
moving up the operand chain of the SILValue until a non-cast instruction is hit.
The non-cast instruction is then returned.
Swift SVN r12906
This reverts commit r12749.
I did not know about the connection in between VALUE_RANGES and abstract SIL
Base types. Using those you can perform the same operation via the isa
operation.
Swift SVN r12763
Thus if one wishes to match a method inst, instead of using a switch one could
just go isMethodInst(Kind) and get the appropriate result.
My hope is this will make life easier by allowing us to use less switches.
Swift SVN r12749
Reuse John's abstraction thunking machinery in SILGenPoly to emit the abstraction change from a protocol requirement to a concrete witness. There are potentially two abstraction changes necessary; if a witness is generic, we need to reabstract again from the concrete substituted type of the witness to the generic witness function's original signature. This currently leads to a bunch of extra temporaries in cases where an argument or return gets unabstracted to a loadable value then reabstracted to a generic parameter, but optimizations should be able to clean this up. Protocol witnesses also have additional potential abstraction changes in their 'self' parameter: the 'self' parameter of the protocol requirement is always considered @inout, but class 'self' parameters are not; also, an operator requirement can be satisfied by a free function, in which case 'self' is discarded.
Also, fix a bug in return value thunking where, if the thunk could reuse its @out parameter as the @out parameter of the underlying function, we would not disable the cleanup we install on the result value, leading to the result getting overreleased.
Swift SVN r11245
a value that still has uses. Doing so leaves dangling pointers and is
unwise. Nothing in the testsuite triggers this, but simplify-cfg can
on real code.
Swift SVN r9770
There are no values other than instructions that can use other values. BBArguments are
defs, not uses. This eliminates a bunch of casts in clients that use getUser().
Swift SVN r9701
Make ApplyInst and PartialApplyInst directly take substitutions for generic functions instead of trying to stage out substitutions separately. The legacy reasons for doing this are gone.
Swift SVN r8747
I’ve added it without understanding the full consequences. If a variant of this is added, it
should take a list of values as the argument. Currently, there is no use for it, so just remove it.
Swift SVN r7238
Remove uncurry level as a property of SILType/SILFunctionTypeInfo. During SIL type lowering, map a (Type, UncurryLevel) pair to a Swift CanType with the uncurried arguments as a Swift tuple. For example, T -> (U, V) -> W at uncurry level 1 becomes ((U, V), T) -> W--in reverse order to match the low-level calling convention. Update SILGen and IRGen all over the place for this representation change.
SILFunctionTypeInfo is still used in the SILType representation, but it's no longer load-bearing. Everything remaining in it can be derived from a Swift type.
This is an ABI break. Be sure to rebuild clean!
Swift SVN r5296