Skip to content

Commit da37a56

Browse files
committed
[sil] Change the immutable address use verifier to ignore br/cond_br uses that introduce address phis and re-enable the test that shows this behavior.
We want to eventually remove address phi arguments from SIL. This will enable all sorts of nice IRGen optimizations and in general make life better. We are not there yet, but given that is the direction we are going in, I don't think there is much use in having to implement this sort of checking for SIL phi arguments. rdar://50676315
1 parent f966020 commit da37a56

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/SIL/SILVerifier.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,14 @@ struct ImmutableAddressUseVerifier {
512512
//
513513
// TODO: Can we do better?
514514
break;
515+
case SILInstructionKind::BranchInst:
516+
case SILInstructionKind::CondBranchInst:
517+
// We do not analyze through branches and cond_br instructions and just
518+
// assume correctness. This is so that we can avoid having to analyze
519+
// through phi loops and since we want to remove address phis (meaning
520+
// that this eventually would never be able to happen). Once that
521+
// changes happens, we should remove this code and just error below.
522+
break;
515523
case SILInstructionKind::ApplyInst:
516524
case SILInstructionKind::TryApplyInst:
517525
case SILInstructionKind::PartialApplyInst:

test/Prototypes/TextFormatting.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// RUN: %target-run-simple-swift | %FileCheck %s
22
// REQUIRES: executable_test
33

4-
// Temporary workaround; ImmutableAddressUseVerifier asserts nondeterministically. rdar://problem/50676315
5-
// REQUIRES: rdar50676315
6-
74
// Text Formatting Prototype
85
//
96
// This file demonstrates the concepts proposed in TextFormatting.rst

0 commit comments

Comments
 (0)