Skip to content

Commit 9402a03

Browse files
committed
---
yaml --- r: 347325 b: refs/heads/master c: 1c09e24 h: refs/heads/master i: 347323: 3363b58
1 parent 1352e5d commit 9402a03

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e77a5c659ca9a243c4e7199984af02591539b990
2+
refs/heads/master: 1c09e2479df94ea6a26de077744493f67a66f205
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/SIL/SILInstruction.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4186,17 +4186,9 @@ class ConvertEscapeToNoEscapeInst final
41864186
SILFunction &F, SILOpenedArchetypesState &OpenedArchetypes,
41874187
bool lifetimeGuaranteed);
41884188
public:
4189-
/// Return true if we have extended the lifetime of the argument of the
4190-
/// convert_escape_to_no_escape to be over all uses of the trivial type.
41914189
bool isLifetimeGuaranteed() const {
41924190
return lifetimeGuaranteed;
41934191
}
4194-
4195-
/// Mark that we have extended the lifetime of the argument of the
4196-
/// convert_escape_to_no_escape to be over all uses of the trivial type.
4197-
///
4198-
/// NOTE: This is a one way operation.
4199-
void setLifetimeGuaranteed() { lifetimeGuaranteed = true; }
42004192
};
42014193

42024194
/// ThinFunctionToPointerInst - Convert a thin function pointer to a

trunk/lib/LLVMPasses/LLVMSwiftAA.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ ModRefInfo SwiftAAResult::getModRefInfo(const llvm::CallBase *Call,
4141
return ModRefInfo::NoModRef;
4242

4343
// Otherwise, delegate to the rest of the AA ModRefInfo machinery.
44-
return AAResultBase::getModRefInfo(Call, Loc);
44+
AAQueryInfo AAQI;
45+
return AAResultBase::getModRefInfo(Call, Loc, AAQI);
4546
}
4647

4748
//===----------------------------------------------------------------------===//

trunk/lib/SILOptimizer/Mandatory/ClosureLifetimeFixup.cpp

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,12 @@ static void extendLifetimeToEndOfFunction(SILFunction &Fn,
123123
auto OptionalEscapingClosureTy = SILType::getOptionalType(EscapingClosureTy);
124124
auto loc = RegularLocation::getAutoGeneratedLocation();
125125

126-
Cvt->setLifetimeGuaranteed();
126+
SILBuilderWithScope B(Cvt);
127+
auto NewCvt = B.createConvertEscapeToNoEscape(
128+
Cvt->getLoc(), Cvt->getOperand(), Cvt->getType(), true);
129+
Cvt->replaceAllUsesWith(NewCvt);
130+
Cvt->eraseFromParent();
131+
Cvt = NewCvt;
127132

128133
// If our Cvt is in the initial block, we do not need to use the SSA updater
129134
// since we know Cvt can not be in a loop and must dominate all exits
@@ -412,7 +417,14 @@ static bool tryExtendLifetimeToLastUse(
412417
// Insert a copy at the convert_escape_to_noescape [not_guaranteed] and
413418
// change the instruction to the guaranteed form.
414419
auto EscapingClosure = Cvt->getOperand();
415-
Cvt->setLifetimeGuaranteed();
420+
{
421+
SILBuilderWithScope B(Cvt);
422+
auto NewCvt = B.createConvertEscapeToNoEscape(
423+
Cvt->getLoc(), Cvt->getOperand(), Cvt->getType(), true);
424+
Cvt->replaceAllUsesWith(NewCvt);
425+
Cvt->eraseFromParent();
426+
Cvt = NewCvt;
427+
}
416428

417429
SILBuilderWithScope B2(Cvt);
418430
auto ClosureCopy = B2.createCopyValue(loc, EscapingClosure);
@@ -498,7 +510,14 @@ static bool trySwitchEnumPeephole(ConvertEscapeToNoEscapeInst *Cvt) {
498510
if (!onlyDestroy)
499511
return false;
500512

501-
Cvt->setLifetimeGuaranteed();
513+
// Replace the convert_escape_to_noescape instruction.
514+
{
515+
SILBuilderWithScope B(Cvt);
516+
auto NewCvt = B.createConvertEscapeToNoEscape(
517+
Cvt->getLoc(), Cvt->getOperand(), Cvt->getType(), true);
518+
Cvt->replaceAllUsesWith(NewCvt);
519+
Cvt->eraseFromParent();
520+
}
502521

503522
// Extend the lifetime.
504523
SILBuilderWithScope B(SwitchEnum1);

0 commit comments

Comments
 (0)