Commit Graph

66 Commits

Author SHA1 Message Date
Chris Lattner
607114f6c6 Introduce a new "emitDestroyAddr" function, which attempts to fold destroy_addr into
preceding copy_addr instruction when totally trivial.  Adopt this in SILGen, eliminating
a couple dozen destroy_addr instructions from the stdlib and producing more canonical SIL.


Swift SVN r8968
2013-10-07 17:47:17 +00:00
Stephen Lin
3f5c0dbf0e Update SILArgument::getModule(), SILBasicBlock::getModule() and SILInstruction::getModule() signatures to match SILFunction::getModule(), for consistency; standardize usage of SILFunction::getParent() to SILFunction::getModule().
Swift SVN r8932
2013-10-04 21:12:20 +00:00
Stephen Lin
2b509fc32c Use visitor to avoid O(N^2) behavior when getting destructured Swift argument types for computing partial apply result type
Swift SVN r8337
2013-09-17 17:16:14 +00:00
Stephen Lin
694f56e2a1 Implement helper to compute partial apply return type; insert convert_function as necessary where this type does not match the needed type
Swift SVN r8315
2013-09-17 00:39:17 +00:00
Stephen Lin
b0cdee2b9b Move SILBuilder::getTupleElementType and SILBuilder::getStructFieldType to SILBuilder.cpp
Swift SVN r8279
2013-09-16 18:19:14 +00:00
Anna Zaks
04b4901b79 [SIL] Split emitBlock() into 2 to remove dependency on construction of a NULL SILLocation.
Swift SVN r8015
2013-09-06 23:57:19 +00:00
Anna Zaks
1ba2554fb2 [SIL] Ensure that all loop branches have valid locations.
Also, change the location of "looping back to head" branch to point to the closing brace of the body, which is a more natural source location than the beginning of the enclosing loop statement.

Swift SVN r7989
2013-09-06 17:46:15 +00:00
Anna Zaks
4d7de376bb [SIL] Refactor splitBasicBlock() into splitBasicBlock and splitBasicBlockAndBranch
This API is more explicit and avoids relying on passing around empty SILLocation.
(No functional change.)

Swift SVN r7988
2013-09-06 17:46:12 +00:00
Chris Lattner
a864b8ea00 enhance the union retain/release implementations to split the block when
inserting a diamond into the middle of an existing block.  This fixes a
problem that manifests in memory promotion when lowering an assign.


Swift SVN r7917
2013-09-04 22:02:50 +00:00
Dmitri Hrybenko
de59d8dcd4 Remove unneeded llvm:: qualifier for llvm::StringRef and llvm::SmallVector
Swift SVN r7089
2013-08-09 18:41:46 +00:00
John McCall
d7b6009374 Introduce the concept of the "semantic" type of a lowered
type and audit a great deal of code to deal with it appropriately.

Spot fixes in a few other places.

Fixes rdar://14615768

Swift SVN r6879
2013-08-03 05:59:19 +00:00
Anna Zaks
ae94c8c48e [DCE] Propagate BB arguments when simplifying a conditional branch into unconditional one
Swift SVN r6819
2013-08-01 21:32:06 +00:00
John McCall
b6d49ea46d Give some dynamic behavior to TypeLowering and lay out
some groundwork for more customization.

Swift SVN r6799
2013-08-01 01:28:39 +00:00
John McCall
f46ffb3382 Shorten "TypeLoweringInfo" to "TypeLowering".
Swift SVN r6795
2013-08-01 01:28:34 +00:00
John McCall
325b86b82a Prepare SIL type lowering to create more expressive type-infos.
Swift SVN r6545
2013-07-24 04:58:49 +00:00
Joe Groff
8ac1bda817 SIL: Move retain/release/destroy helpers onto SILBuilder.
Add a convenience SILModule::getTypeLoweringInfo forwarder, and move the emitRetainRValue and emitReleaseRValue helpers from SILGenFunction to SILBuilder so they're more readily available to non-SILGen passes. Add an emitDestroyAddress helper that emits nothing, destroy_addr, or load + release based on the value semantics of the referenced type.

Swift SVN r6431
2013-07-21 18:39:56 +00:00