mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SILCombine: fix propagation of concrete existentials in enums
This peephole optimization didn't consider that an alloc_stack of an enum can be overridden by another value. The fix is to remove this peephole optimization at all because it is already covered by `optimizeEnum` in alloc_stack simplification. Fixes a miscompile https://github.com/swiftlang/swift/issues/85687 rdar://165374568
This commit is contained in:
@@ -213,14 +213,6 @@ castValueToABICompatibleType(SILBuilder *builder, SILPassManager *pm,
|
||||
/// ```
|
||||
bool layoutIsTypeDependent(NominalTypeDecl *decl);
|
||||
|
||||
/// Peek through trivial Enum initialization, typically for pointless
|
||||
/// Optionals.
|
||||
///
|
||||
/// The returned InitEnumDataAddr dominates the given
|
||||
/// UncheckedTakeEnumDataAddrInst.
|
||||
InitEnumDataAddrInst *
|
||||
findInitAddressForTrivialEnum(UncheckedTakeEnumDataAddrInst *utedai);
|
||||
|
||||
/// Returns a project_box if it is the next instruction after \p ABI and
|
||||
/// and has \p ABI as operand. Otherwise it creates a new project_box right
|
||||
/// after \p ABI and returns it.
|
||||
|
||||
Reference in New Issue
Block a user