Skip to content

[sil] Split operand ownership classification from SILOwnershipVerifie… #19732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions include/swift/SIL/OwnershipUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define SWIFT_SIL_OWNERSHIPUTILS_H

#include "swift/Basic/LLVM.h"
#include "swift/SIL/SILValue.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"

Expand Down Expand Up @@ -101,6 +102,22 @@ bool valueHasLinearLifetime(SILValue value,
DeadEndBlocks &deadEndBlocks,
ownership::ErrorBehaviorKind errorBehavior);

/// Returns true if v is an address or trivial.
bool isValueAddressOrTrivial(SILValue v, SILModule &m);

/// These operations forward both owned and guaranteed ownership.
bool isOwnershipForwardingValueKind(SILNodeKind kind);

/// These operations forward guaranteed ownership, but don't necessarily forward
/// owned values.
bool isGuaranteedForwardingValueKind(SILNodeKind kind);

bool isGuaranteedForwardingValue(SILValue value);

bool isGuaranteedForwardingInst(SILInstruction *i);

bool isOwnershipForwardingInst(SILInstruction *i);

} // namespace swift

#endif
2 changes: 2 additions & 0 deletions lib/SIL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ add_swift_library(swiftSIL STATIC
LinearLifetimeChecker.cpp
LoopInfo.cpp
Notifications.cpp
OperandOwnership.cpp
OptimizationRemark.cpp
OwnershipUtils.cpp
PrettyStackTrace.cpp
Projection.cpp
SIL.cpp
Expand Down
Loading