mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ownership] Change SILUndef to return Any ownership for trivial values and owned for non-trivial values.
This is in preparation for verifying that when ownership verification is enabled that only enums and trivial values can have any ownership. I am doing this in preparation for eliminating ValueOwnershipKind::Trivial. rdar://46294760
This commit is contained in:
@@ -1619,7 +1619,7 @@ protected:
|
||||
}
|
||||
|
||||
void updateSSAForm() {
|
||||
SILSSAUpdater SSAUp;
|
||||
SILSSAUpdater SSAUp(StartBB->getParent()->getModule());
|
||||
for (auto *origBB : originalPreorderBlocks()) {
|
||||
// Update outside used phi values.
|
||||
for (auto *arg : origBB->getArguments())
|
||||
|
||||
@@ -174,7 +174,7 @@ rewriteNewLoopEntryCheckBlock(SILBasicBlock *Header,
|
||||
SILBasicBlock *EntryCheckBlock,
|
||||
const llvm::DenseMap<ValueBase *, SILValue> &ValueMap) {
|
||||
SmallVector<SILPhiArgument *, 4> InsertedPHIs;
|
||||
SILSSAUpdater Updater(&InsertedPHIs);
|
||||
SILSSAUpdater Updater(Header->getParent()->getModule(), &InsertedPHIs);
|
||||
|
||||
// Fix PHIs (incoming arguments).
|
||||
for (auto *Arg : Header->getArguments())
|
||||
|
||||
@@ -305,9 +305,9 @@ void LoopCloner::collectLoopLiveOutValues(
|
||||
}
|
||||
|
||||
static void
|
||||
updateSSA(SILLoop *Loop,
|
||||
updateSSA(SILModule &M, SILLoop *Loop,
|
||||
DenseMap<SILValue, SmallVector<SILValue, 8>> &LoopLiveOutValues) {
|
||||
SILSSAUpdater SSAUp;
|
||||
SILSSAUpdater SSAUp(M);
|
||||
for (auto &MapEntry : LoopLiveOutValues) {
|
||||
// Collect out of loop uses of this value.
|
||||
auto OrigValue = MapEntry.first;
|
||||
@@ -335,6 +335,7 @@ static bool tryToUnrollLoop(SILLoop *Loop) {
|
||||
auto *Preheader = Loop->getLoopPreheader();
|
||||
if (!Preheader)
|
||||
return false;
|
||||
SILModule &M = Preheader->getParent()->getModule();
|
||||
|
||||
auto *Latch = Loop->getLoopLatch();
|
||||
if (!Latch)
|
||||
@@ -409,7 +410,7 @@ static bool tryToUnrollLoop(SILLoop *Loop) {
|
||||
}
|
||||
|
||||
// Fixup SSA form for loop values used outside the loop.
|
||||
updateSSA(Loop, LoopLiveOutValues);
|
||||
updateSSA(M, Loop, LoopLiveOutValues);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user