Skip to content
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

[SR-1111] Non-optimized builds should avoid redundant thick_to_objc_metatype conversions #43724

Open
belkadan opened this issue Mar 30, 2016 · 0 comments
Labels
compiler The Swift compiler itself good first issue Good for newcomers improvement IRGen LLVM IR generation non-optimized only Flag: An issue whose reproduction requires non-optimized compilation

Comments

@belkadan
Copy link
Contributor

Previous ID SR-1111
Radar None
Original Reporter @belkadan
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, IRGen, NotOptimizedOnly, StarterBug
Assignee None
Priority Medium

md5: ee5fa37243b2596a51a6125675863696

Issue Description:

In this code:

import Foundation
func test() -> Bool {
  let a = RunLoop.current
  let b = RunLoop.main
  return a === b
}

We're smart enough to avoid emitting two references to the metadata for NSRunLoop, but not smart enough (in -Onone builds) to avoid emitting the conversion to an ObjC Class twice, which involves a branch. We should be able to reuse the value from the first thick_to_objc_metatype conversion.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler itself good first issue Good for newcomers improvement IRGen LLVM IR generation non-optimized only Flag: An issue whose reproduction requires non-optimized compilation
Projects
None yet
Development

No branches or pull requests

1 participant