Skip to content

Fix conflicts merging main into next #66937

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
merged 285 commits into from
Jun 26, 2023

Conversation

felipepiovezan
Copy link
Contributor

The following tests required conflict resolution, since upstream LLVM did a lot of
work to remove dbg.addr, and this work is not available to swift's main. At the
same time, swift's main changed these tests to enable opaque pointers.

both modified:   test/DebugInfo/async-let-await.swift
both modified:   test/DebugInfo/move_function_dbginfo.swift
both modified:   test/DebugInfo/move_function_dbginfo_async.swift

The conflicts are fairly easy to fix: we keep the "structure" of the CHECK
lines present in next, but replace all pointers with ptr.

nate-chandler and others added 30 commits June 16, 2023 14:50
Its storage vector is intended to be of some type like
`std::vector<std::pair<Key, Optional<Value>>>`, i.e., some collection of
pairs whose `second` is an `Optional<Value>`.  So when constructing a
default instance of that pair, just construct an Optional in the None
case.
…y initialized.

This leads to unhandled complications in the move-only checker that were causing miscompiles.
We can disallow this for now. rdar://109695770
…nsuming

this was staged in as a warning initially but it was intended to be
an error if it is not written so that we can move to a world where
these pattern matches are done as a borrowing operation instead.

rdar://110908714
swiftlang#66707)

* [IRGen] Use EnumImplStrategy to generate getEnumTag function for layout strings

rdar://110794898

The implementation in TypeLayout seems to have a bug causing wrong tags to be returned on 32 bit systems.

* Don't use unsupported types in tests
Iterating all options and potential file system access is not great for
every plugin lookup request. Instead, lazily create a single lookup table
keyed by module name.
Enable IRGen/protocol_metadata test on Apple Silicon
[SILOptimizer] Don't optimize move-only lifetimes.
require `consume x` for noncopyable pattern bindings since they're consuming
FieldSensitivePrunedLiveness is used as a vectorization of
PrunedLiveness.  An instance of FSPL with N elements needs to be able to
represent the same states as N instances of PL.

Previously, it failed to do that in two significant ways:

(1) It attempted to save space for which elements were live by using
    a range.  This failed to account for instructions which are users of
    non-contiguous fields of an aggregate.

    apply(
      @owned (struct_element_addr %s, #S.f1),
      @owned (struct_element_addr %s, #S.f3)
    )

(2) It used a single bit to represent whether the instruction was
    consuming.  This failed to account for instructions which consumed
    some fields and borrowed others.

    apply(
      @owned (struct_element_addr %s, #S.f1),
      @guaranteed (struct_element_addr %s, #S.f2)
    )

The fix for (1) is to use a bit vector to represent which elements
are used by the instruction.  The fix for (2) is to use a second bit
vector to represent which elements are _consumed_ by the instruction.

Adapted the move-checker to use the new representation.

rdar://110909290
Dumped more info and called llvm_unreachable on bad state.
Previously, the checker inserted destroys after each last use.  Here,
extend the lifetimes of fields as far as possible within their original
(unchecked) limits.

rdar://99681073
It's always the first line of the function, so try to do better.
Passing

```
-Xllvm -move-only-address-checker-disable-lifetime-extension=true
```

will skip the maximization of unconsumed field lifetimes.
…rvable

At one point this gave us trouble, but it's since been fixed. Add the
test to make sure we don't regress. Covers rdar://109231047.
…debug_info_opaque_ptrs

[DebugInfo] Update tests to use opaque ptrs
SILDebugScopes: Don't ignore ConditionalClauseInitializerScope.
[MoveOnlyAddressChecker] Maximize lifetimes.
The address checker records uses in its livenessUses map.  Previously,
that map mapped from an instruction to a range of fields of the type.
But an instruction can use multiple discontiguous fields of a single
value.  Here, such instructions are properly recorded by fixing the map
to store a bit vector for each instruction.

rdar://110676577
```
../include/swift/SIL/FieldSensitivePrunedLiveness.h:531:54: warning: 'hasValue' is deprecated: Use has_value instead. [-Wdeprecated-declarations]
  bool isInitialized() const { return numBitsToTrack.hasValue(); }
                                                     ^~~~~~~~
                                                     has_value
```
[MoveOnlyAddressChecker] Fix representation for used fields.
…617/1/fix-warning

Gardening: Silenced Optional::hasValue warning.
Add frontend flag for explicitly setting ccc
This patch adds the metadata registration for the wasm targets, and also
adds build support for it.
…3fc716c8f3b55bfd113d3972dc3bb6

[wasm][build] Recognize wasi-wasm32 as valid host
…ure-type-constraint

[ConstraintSystem] Use fallback type constraint to default pack expansion
…5a694965ab652f57cbfead006a33d7

[static-stdlib] Move static-executable-args.lnk under stdlib/public/Resources/linux
ktoso and others added 7 commits June 24, 2023 17:44
…lation-bigger-change

[SoruceKit] Audit SwiftASTManager to prevent deadlocks
[ConstraintSystem] Fix keyPath diagnostic error for value convert to contextual types
[ConstraintSystem] Adjust the way pack parameters are opened
[CursorInfo] Pass primary path to allow comparing previous ASTs
[stdlib] Add support for classes in _createOffsetBasedKeyPath
The following tests required conflict resolutions, since upstream LLVM did a lot of
work to remove dbg.addr, and this work is not available to swift's main. At the
same time, swift's main changed these tests to enable opaque pointers.

```
both modified:   test/DebugInfo/async-let-await.swift
both modified:   test/DebugInfo/move_function_dbginfo.swift
both modified:   test/DebugInfo/move_function_dbginfo_async.swift
```

The conflicts are fairly easy to fix: we keep the "structure" of the CHECK
lines present in `next`, but replace all pointers with `ptr`.
@felipepiovezan felipepiovezan merged commit 62a0475 into swiftlang:next Jun 26, 2023
@felipepiovezan felipepiovezan deleted the felipe/fix_merge_opaque branch June 26, 2023 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.