Skip to content

Conversation

@dan-zheng
Copy link
Contributor

@dan-zheng dan-zheng commented May 27, 2020

[SIL] Fix alloc_stack [dynamic_lifetime] attribute cloning.

Make SILCloner:visitAllocStack correctly propagate the [dynamic_lifetime] attribute.

Resolves SR-12886: differentiation transform error related to the VJPEmitter
subclass of SILCloner.


[AutoDiff] Fix SIL locations and debug scopes.

Fix SIL locations and debug scopes in VJPEmitter for:

  • Pullback struct struct instructions
  • Predecessor enums enum instructions

These instructions are not directly cloned from the original function and should
have auto-generated locations.

Resolves SR-12887: debug scope error for VJPEmitter-generated functions.

@dan-zheng dan-zheng requested review from gottesmm, marcrasi and rxwei May 27, 2020 00:59
@dan-zheng
Copy link
Contributor Author

@gottesmm: would you like to sanity check this PR? It should not be controversial.

@dan-zheng
Copy link
Contributor Author

@swift-ci Please test

Copy link
Contributor

@rxwei rxwei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: [dynamic_lifetime], not [dynamic_replacement].

@dan-zheng dan-zheng changed the title [SIL] Fix alloc_stack [dynamic_replacement] attribute cloning. [SIL] Fix alloc_stack [dynamic_lifetime] attribute cloning. May 27, 2020
@dan-zheng dan-zheng force-pushed the fix-alloc-stack-cloning branch from de31fab to 8563a3a Compare May 27, 2020 01:05
@dan-zheng
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - de31fab9c6f18fadb29872dcefaac4dd6e8affb8

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - de31fab9c6f18fadb29872dcefaac4dd6e8affb8

@dan-zheng dan-zheng force-pushed the fix-alloc-stack-cloning branch from 8563a3a to 6f5d4cc Compare May 27, 2020 01:27
@dan-zheng
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 8563a3a78e588a78bc01ae447ee38686b3d5f0a0

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 8563a3a78e588a78bc01ae447ee38686b3d5f0a0

@dan-zheng dan-zheng changed the title [SIL] Fix alloc_stack [dynamic_lifetime] attribute cloning. [AutoDiff] Fix differentiation crashes related to definite initialization. May 27, 2020
@dan-zheng
Copy link
Contributor Author

The test for verification error SR-12886 added in the first commit revealed a second verification error SR-12887, so I pushed a fix for that too.

Updated PR title and description.

@dan-zheng
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 6f5d4ccd3da998c1ab1addcd5b0039ddcf3ee768

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 6f5d4ccd3da998c1ab1addcd5b0039ddcf3ee768

@dan-zheng
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1017baa246b3702f4a0c97173be87eeaee488c04

@dan-zheng
Copy link
Contributor Author

Unrelated llvm macOS CI error.
@swift-ci Please test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 1017baa246b3702f4a0c97173be87eeaee488c04

@dan-zheng
Copy link
Contributor Author

Linux CI appears to have flaked while building SwiftPM.
@swift-ci Please test Linux

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 1017baa246b3702f4a0c97173be87eeaee488c04

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1017baa246b3702f4a0c97173be87eeaee488c04

@dan-zheng
Copy link
Contributor Author

Linux and macOS platform tests have both flaked multiple times. I'll try smoke tests instead.

@dan-zheng
Copy link
Contributor Author

@swift-ci Please smoke test

@dan-zheng dan-zheng force-pushed the fix-alloc-stack-cloning branch from 1017baa to a27860a Compare May 28, 2020 19:26
@dan-zheng
Copy link
Contributor Author

@swift-ci Please smoke test

dan-zheng added 2 commits May 29, 2020 01:56
Make `SILCloner:visitAllocStack` correctly propagate the `[dynamic_lifetime]`
attribute.

Resolves SR-12886: differentiation transform error related to the `VJPEmitter`
subclass of `SILCloner`.
Fix SIL locations and debug scopes in `VJPEmitter` for:
- Pullback struct `struct` instructions
- Predecessor enums `enum` instructions

These instructions are not directly cloned from the original function and should
have auto-generated locations.

Resolves SR-12887: debug scope error for `VJPEmitter`-generated function.
@dan-zheng dan-zheng force-pushed the fix-alloc-stack-cloning branch from 58717e4 to ff97ae7 Compare May 29, 2020 09:07
@dan-zheng
Copy link
Contributor Author

@swift-ci Please smoke test Linux

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.

3 participants