Commit Graph

8 Commits

Author SHA1 Message Date
Michael Gottesman
436f022867 [local] Add tryDeleteDeadClosures.
This utility attempts to delete dead closures with a set of
post-dominating releases using the infrastructure from
getFinalReleasesForValue.

It currently only will eliminate closures that only have retain, release
uses and a final post-dominating release set.

The reason why we need the final post-dominating release set is so that
we can release any captured variables at the points where we would have
deallocated the release. This is b/c captured variables are passed in at
+1 to partial apply.

Swift SVN r25050
2015-02-06 21:59:52 +00:00
Michael Gottesman
a83b00b3c7 [value-tracking] Add an API to value tracking for determining dead closures.
I am going to use this in closure specialization to remove dead closures. We
should refactor the SILCombine dead closure removal to use this code path as
well.

Additionally, we should change the valueMayBeCaptured infrastructure to take a
struct like we do in LLVM so we can ignore casts and other things like that
additionally by injecting the logic to do so via the struct.

But that is for another day.

Swift SVN r25007
2015-02-05 19:11:35 +00:00
Joe Groff
e3f9a2035c SIL: Move SILGen and passes over to use "builtin" instead of "apply (builtin_function_ref)".
Swift SVN r22785
2014-10-15 23:37:22 +00:00
Jordan Rose
3fcdfd40e9 Remove the "swift/Basic/Optional.h" header.
llvm::Optional lives in "llvm/ADT/Optional.h". Like Clang, we can get
Optional in the 'swift' namespace by including "swift/Basic/LLVM.h".

We're now fully switched over to llvm::Optional!

Swift SVN r22477
2014-10-02 18:51:45 +00:00
Roman Levenstein
a81a99776f Improve optimization of builtin operations that may overflow. Remove overflow checks if it can be proven that no overflow can happen.
Swift SVN r21874
2014-09-11 16:00:54 +00:00
Roman Levenstein
933e4bff17 [sil-simplify] Peepholes for (trunc (s_to_u (zext x)))->x and (trunc (u_to_s (zext (lshr x 1) Word -> Int64)) Int64 -> Word) -> (lshr x 1).
Related to rdar://17433082 and rdar://17406327

Swift SVN r21700
2014-09-04 10:27:08 +00:00
Michael Gottesman
75d8e4d748 [sil-combine] Move isZeroValue out of SILCombine and into ValueTracking.
Swift SVN r21540
2014-08-28 21:27:53 +00:00
Michael Gottesman
b04b14e0fa Refactor isNonEscapingLocalObject/getUnderlying object into their own file ValueTracking.cpp.
This is because I need them in ARCAnalysis.cpp and from a modeling
perspective it is no longer just going to be used just in AA since they
are of larger functionality.

Swift SVN r16297
2014-04-14 04:44:53 +00:00