This commit removes the public method for fetching SideEffectsAnalysis. The
dependency on SEA is now an implementation detail of AliasAnalysis and
computeMemoryBehavior.
getMemoryBehavior is also used by SILInstruction. This commit renames
getMemoryBehavior to computeMemoryBehavior and cleans some of the code
that touches it.
This fixes type punning issues with unsafeBitCast.
The optimizer is still too aggressive with UnsafePointer. To fix that,
we first need an explicit API for circumventing type safety
(rdar://23406272).
I should be able to fix the following regressions by migrating the
stdlib away from unsafeBitCast to unsafeReferenceCast (~2 weeks).
Slowdowns:
|.Benchmark.................|..Before.|...After.|.Speedup|
|.ArrayInClass..............|...49.00.|...78.00.|.-37.2%.|
|.Sim2DArray................|..471.00.|..549.00.|.-14.2%.|
|.PrimeNum..................|.1876.00.|.1980.00.|..-5.3%.|
Speedups:
|.Benchmark.................|..Before.|...After.|.Speedup|
|.HeapSort..................|.2962.00.|.2663.00.|..11.2%.|
|.StdlibSort................|.2672.00.|.2537.00.|...5.3%.|
It's generally bad practice to assume use lists are small. I think
part of MemoryBehaviorVisitor's contract is that the Value being
queried has the same level of type information across visits.
This code is self contained was almost 1/2 of all of the code in
AliasAnalysis.cpp. This combined with the fact that we are most likely going to
add more code suggests that it should be refactored out.
Swift SVN r32284