Skip to content

Commit feb6c42

Browse files
committed
Ban address phis in non-OSSA as well
1 parent d068eac commit feb6c42

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
@@ -985,24 +985,6 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
985985
return InstNumbers[a] < InstNumbers[b];
986986
}
987987

988-
// FIXME: For sanity, address-type phis should be prohibited at all SIL
989-
// stages. However, the optimizer currently breaks the invariant in three
990-
// places:
991-
// 1. Normal Simplify CFG during conditional branch simplification
992-
// (sneaky jump threading).
993-
// 2. Simplify CFG via Jump Threading.
994-
// 3. Loop Rotation.
995-
//
996-
// BasicBlockCloner::canCloneInstruction and sinkAddressProjections is
997-
// designed to avoid this issue, we just need to make sure all passes use it
998-
// correctly.
999-
//
1000-
// Minimally, we must prevent address-type phis as long as access markers are
1001-
// preserved. A goal is to preserve access markers in OSSA.
1002-
bool prohibitAddressPhis() {
1003-
return F.hasOwnership();
1004-
}
1005-
1006988
void visitSILPhiArgument(SILPhiArgument *arg) {
1007989
// Verify that the `isPhiArgument` property is sound:
1008990
// - Phi arguments come from branches.
@@ -1026,7 +1008,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
10261008
"All phi argument inputs must be from branches.");
10271009
}
10281010
}
1029-
if (arg->isPhi() && prohibitAddressPhis()) {
1011+
if (arg->isPhi()) {
10301012
// As a property of well-formed SIL, we disallow address-type
10311013
// phis. Supporting them would prevent reliably reasoning about the
10321014
// underlying storage of memory access. This reasoning is important for

0 commit comments

Comments
 (0)