Skip to content

Commit 56629e1

Browse files
committed
Verify we don't have any address phis
1 parent b08eb62 commit 56629e1

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,24 +1065,6 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
10651065
return InstNumbers[a] < InstNumbers[b];
10661066
}
10671067

1068-
// FIXME: For sanity, address-type phis should be prohibited at all SIL
1069-
// stages. However, the optimizer currently breaks the invariant in three
1070-
// places:
1071-
// 1. Normal Simplify CFG during conditional branch simplification
1072-
// (sneaky jump threading).
1073-
// 2. Simplify CFG via Jump Threading.
1074-
// 3. Loop Rotation.
1075-
//
1076-
// BasicBlockCloner::canCloneInstruction and sinkAddressProjections is
1077-
// designed to avoid this issue, we just need to make sure all passes use it
1078-
// correctly.
1079-
//
1080-
// Minimally, we must prevent address-type phis as long as access markers are
1081-
// preserved. A goal is to preserve access markers in OSSA.
1082-
bool prohibitAddressPhis() {
1083-
return F.hasOwnership();
1084-
}
1085-
10861068
void visitSILPhiArgument(SILPhiArgument *arg) {
10871069
// Verify that the `isPhiArgument` property is sound:
10881070
// - Phi arguments come from branches.
@@ -1106,7 +1088,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
11061088
"All phi argument inputs must be from branches.");
11071089
}
11081090
}
1109-
if (arg->isPhi() && prohibitAddressPhis()) {
1091+
if (arg->isPhi()) {
11101092
// As a property of well-formed SIL, we disallow address-type
11111093
// phis. Supporting them would prevent reliably reasoning about the
11121094
// underlying storage of memory access. This reasoning is important for

0 commit comments

Comments
 (0)