Skip to content

Commit e37dbf8

Browse files
authored
Merge pull request #19732 from gottesmm/pr-66a523eae15afbe54d55ad162517c83806096dee
[sil] Split operand ownership classification from SILOwnershipVerifie…
2 parents 326e564 + 1baf38c commit e37dbf8

File tree

5 files changed

+1275
-1220
lines changed

5 files changed

+1275
-1220
lines changed

include/swift/SIL/OwnershipUtils.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define SWIFT_SIL_OWNERSHIPUTILS_H
1515

1616
#include "swift/Basic/LLVM.h"
17+
#include "swift/SIL/SILValue.h"
1718
#include "llvm/ADT/SmallPtrSet.h"
1819
#include "llvm/ADT/SmallVector.h"
1920

@@ -101,6 +102,22 @@ bool valueHasLinearLifetime(SILValue value,
101102
DeadEndBlocks &deadEndBlocks,
102103
ownership::ErrorBehaviorKind errorBehavior);
103104

105+
/// Returns true if v is an address or trivial.
106+
bool isValueAddressOrTrivial(SILValue v, SILModule &m);
107+
108+
/// These operations forward both owned and guaranteed ownership.
109+
bool isOwnershipForwardingValueKind(SILNodeKind kind);
110+
111+
/// These operations forward guaranteed ownership, but don't necessarily forward
112+
/// owned values.
113+
bool isGuaranteedForwardingValueKind(SILNodeKind kind);
114+
115+
bool isGuaranteedForwardingValue(SILValue value);
116+
117+
bool isGuaranteedForwardingInst(SILInstruction *i);
118+
119+
bool isOwnershipForwardingInst(SILInstruction *i);
120+
104121
} // namespace swift
105122

106123
#endif

lib/SIL/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ add_swift_library(swiftSIL STATIC
1111
LinearLifetimeChecker.cpp
1212
LoopInfo.cpp
1313
Notifications.cpp
14+
OperandOwnership.cpp
1415
OptimizationRemark.cpp
16+
OwnershipUtils.cpp
1517
PrettyStackTrace.cpp
1618
Projection.cpp
1719
SIL.cpp

0 commit comments

Comments
 (0)