Commit Graph

6 Commits

Author SHA1 Message Date
Erik Eckstein
1de19a1b32 SimplifyCFG: fix a compile time problem with block merging
When merging many blocks to a single block (in the wrong order), instructions are getting moved over and over again.
This is quadratic and can result in very long compile times for large functions.
To fix this, always move the instruction to smaller block to the larger block.

rdar://problem/56268570
2020-04-10 20:10:24 +02:00
Bob Wilson
e4cc933f70 master-next: adjust test output for change in LLVM block syntax
LLVM r356789 changed the format of textual IR to print nameless
blocks with labels instead of comments with "; <label>". Adjust Swift
tests to match. I also updated the utils/viewcfg script to match.
2019-03-29 18:19:26 -07:00
Andrew Trick
23a68b9bb5 Fix an overspecific lit check: unsafebufferpointer.swift.
<rdar://problem/48016982> TEST 'Swift(iphonesimulator-i386) :: SILOptimizer/unsafebufferpointer.swift' FAILED
2019-02-12 17:12:39 -08:00
Andrew Trick
a07311f80c Fix a unit test for 32-bit platforms. 2019-02-11 12:22:16 -08:00
Andrew Trick
a557976f95 Remove useless optional unwrap from Unsafe[Raw]BufferPointer subscript.
It is unfortunate that `Unsafe[Raw]BufferPointer._pointer` and
`baseAddress` are declared Optional. This leaves extra runtime checks
in the code in the most performance critical paths. Contrast this with
Array, which uses an sentinal pointer for the empty representation.

This forces us to use _unsafelyUnwrappedUnchecked whenever we just
want to dereference a non-empty buffer pointer.

Fixes SR-9809: swiftc appears to make some sub-optimal optimization choices
2019-02-03 21:25:41 -08:00
Erik Eckstein
72038b58a3 stdlib: change the representation of UnsafeBufferPointer from start+end pointers to start-pointer + count.
This saves a few instructions for some operations, like getting the count.
Also, it avoids the check for unwrapping the optional end pointer. For example, iterating over an unsafe buffer now has no overhead.

Also remove the _unboundedStartingAt initializer, which is not needed anymore.
2018-05-29 11:01:03 -07:00