Skip to content

[mandatory-inlining] Update for ownership. #22085

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

Conversation

gottesmm
Copy link
Contributor

This is rebased from many months ago with some small updates for recent work by
Arnold.

This is rebased from many months ago with some small updates for recent work by
Arnold.
@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm
Copy link
Contributor Author

@swift-ci test source compatibility

@gottesmm
Copy link
Contributor Author

The failure in the Debug Source Compat Suite is a UPASS.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 188551c

ownership::ErrorBehaviorKind::ReturnFalseOnLeakAssertOtherwise;

// Ok, at this point we know that we have a direct SSA relationship in between
// our partial_apply and
Copy link
Contributor

Choose a reason for hiding this comment

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

and ?

}

// If we have an owned value, we need to insert a copy here for lifetime
// extension purposes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we improve the comment: If we have an owned value, we insert the copy for two purposes: first, to balance the consuming argument, this also has the effect to satisfy the second purpose of extending the lifetime.

Copy link
Contributor

@aschwaighofer aschwaighofer left a comment

Choose a reason for hiding this comment

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

looks good to me

@gottesmm
Copy link
Contributor Author

@swift-ci test macOS platform

@gottesmm
Copy link
Contributor Author

@aschwaighofer I am going to fix the changes you suggested post-commit.

@gottesmm gottesmm merged commit 05b6ace into swiftlang:master Jan 26, 2019
@gottesmm gottesmm deleted the pr-7a133e2f8de39c6e863d7fc48daf761e36994bfa branch January 26, 2019 06:06
@benrimmington
Copy link
Contributor

@gottesmm Two tests are failing for me locally:

SILOptimizer/mandatory_inlining.sil
FAIL: Swift(macosx-x86_64) :: SILOptimizer/mandatory_inlining.sil (1 of 2)
******************** TEST 'Swift(macosx-x86_64) :: SILOptimizer/mandatory_inlining.sil' FAILED ********************
Script:
--
: 'RUN: at line 1';   xcrun --toolchain default --sdk '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' /Users/benrimmington/Repositories/apple/build/Ninja-DebugAssert/swift-macosx-x86_64/bin/sil-opt -target x86_64-apple-macosx10.9  -module-cache-path '/Users/benrimmington/Repositories/apple/build/Ninja-DebugAssert/swift-macosx-x86_64/swift-test-results/x86_64-apple-macosx10.9/clang-module-cache'  -enable-objc-interop -module-name mandatory_inlining -enable-sil-verify-all /Users/benrimmington/Repositories/apple/swift/test/SILOptimizer/mandatory_inlining.sil -mandatory-inlining | '/usr/bin/python' '/Users/benrimmington/Repositories/apple/swift/utils/PathSanitizingFileCheck' --sanitize BUILD_DIR='/Users/benrimmington/Repositories/apple/build/Ninja-DebugAssert/swift-macosx-x86_64' --sanitize SOURCE_DIR='/Users/benrimmington/Repositories/apple/swift' --use-filecheck '/Users/benrimmington/Repositories/apple/build/Ninja-DebugAssert/llvm-macosx-x86_64/bin/FileCheck' /Users/benrimmington/Repositories/apple/swift/test/SILOptimizer/mandatory_inlining.sil
--
Exit Code: 1

Command Output (stderr):
--
/Users/benrimmington/Repositories/apple/swift/test/SILOptimizer/mandatory_inlining.sil:608:12: error: CHECK: expected string not found in input
 // CHECK: [[ADDR4:%.*]] = project_box [[VAL4:%.*]] :
           ^
<stdin>:577:2: note: scanning from here
 %29 = apply %26() : $@callee_owned () -> Bool // user: %30
 ^
<stdin>:577:14: note: possible intended match here
 %29 = apply %26() : $@callee_owned () -> Bool // user: %30
             ^
/Users/benrimmington/Repositories/apple/swift/test/SILOptimizer/mandatory_inlining.sil:654:12: error: CHECK: expected string not found in input
 // CHECK: [[ADDR4:%.*]] = project_box [[VAL4:%[0-9]+]]
           ^
<stdin>:629:2: note: scanning from here
 %30 = apply %27() : $@callee_owned () -> Bool // user: %31
 ^
<stdin>:630:8: note: possible intended match here
 br bb3(%30 : $Bool) // id: %31
       ^

--

********************
SILOptimizer/mandatory_inlining_ownership2.sil
FAIL: Swift(macosx-x86_64) :: SILOptimizer/mandatory_inlining_ownership2.sil (2 of 2)
******************** TEST 'Swift(macosx-x86_64) :: SILOptimizer/mandatory_inlining_ownership2.sil' FAILED ********************
Script:
--
: 'RUN: at line 1';   xcrun --toolchain default --sdk '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk' /Users/benrimmington/Repositories/apple/build/Ninja-DebugAssert/swift-macosx-x86_64/bin/sil-opt -target x86_64-apple-macosx10.9  -module-cache-path '/Users/benrimmington/Repositories/apple/build/Ninja-DebugAssert/swift-macosx-x86_64/swift-test-results/x86_64-apple-macosx10.9/clang-module-cache'  -enable-sil-ownership -enable-objc-interop -module-name mandatory_inlining -enable-sil-verify-all /Users/benrimmington/Repositories/apple/swift/test/SILOptimizer/mandatory_inlining_ownership2.sil -mandatory-inlining | '/usr/bin/python' '/Users/benrimmington/Repositories/apple/swift/utils/PathSanitizingFileCheck' --sanitize BUILD_DIR='/Users/benrimmington/Repositories/apple/build/Ninja-DebugAssert/swift-macosx-x86_64' --sanitize SOURCE_DIR='/Users/benrimmington/Repositories/apple/swift' --use-filecheck '/Users/benrimmington/Repositories/apple/build/Ninja-DebugAssert/llvm-macosx-x86_64/bin/FileCheck' /Users/benrimmington/Repositories/apple/swift/test/SILOptimizer/mandatory_inlining_ownership2.sil
--
Exit Code: 1

Command Output (stderr):
--
/Users/benrimmington/Repositories/apple/swift/test/SILOptimizer/mandatory_inlining_ownership2.sil:600:11: error: CHECK: expected string not found in input
// CHECK: [[BOX2_COPY_COPY:%.*]] = copy_value [[BOX2_COPY]]
          ^
<stdin>:551:22: note: scanning from here
 %10 = copy_value %4 : ${ var Bool } // user: %11
                     ^
<stdin>:551:22: note: with variable "BOX2_COPY" equal to "%10"
 %10 = copy_value %4 : ${ var Bool } // user: %11
                     ^
<stdin>:560:18: note: possible intended match here
 // function_ref get_logic_value
                 ^
/Users/benrimmington/Repositories/apple/swift/test/SILOptimizer/mandatory_inlining_ownership2.sil:647:11: error: CHECK: expected string not found in input
// CHECK: [[BOX2_COPY_COPY:%.*]] = copy_value [[BOX2_COPY]]
          ^
<stdin>:601:22: note: scanning from here
 %10 = copy_value %4 : ${ var Bool } // user: %11
                     ^
<stdin>:601:22: note: with variable "BOX2_COPY" equal to "%10"
 %10 = copy_value %4 : ${ var Bool } // user: %11
                     ^
<stdin>:603:2: note: possible intended match here
 %12 = copy_value %11 : $@callee_owned () -> Bool // user: %18
 ^

--

********************

@gottesmm
Copy link
Contributor Author

@benrimmington Thanks. I am already aware of this/investigating. What is weird is that this isn't failing on ci.swift.org AFAIKT.

@gottesmm
Copy link
Contributor Author

@benrimmington undefined behavior strikes again! I didn't null initialize a pointer that needed to be null initialize (we need to setup a ub-san bot for swift).

@gottesmm
Copy link
Contributor Author

@benrimmington #22163

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.

4 participants