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-1103] Redundant metadata accesses when invoking ObjC protocol methods #43716

Open
jckarter opened this issue Mar 29, 2016 · 1 comment
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers IRGen LLVM IR generation

Comments

@jckarter
Copy link
Member

Previous ID SR-1103
Radar None
Original Reporter @jckarter
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, IRGen, StarterBug
Assignee None
Priority Medium

md5: 970c1d7db6290aee45b5ecc9fd1e9432

Issue Description:

Protocol methods are modeled as functions generic on Self, so IRGen tries to get the type metadata to satisfy the formal type parameter, even though it's not used for an ObjC or C protocol method:

define void @invoke_protocol_methods(%objc_object*) #​0 {
entry:
  %.Type = call %swift.type* @swift_getObjectType(%objc_object* %0) #​2
  %1 = bitcast %objc_object* %0 to i8*
  call void @mutateSomeState(i8* %1)
  ret void
}

The call is marked readnone so gets optimized away, but we shouldn't emit it at all for the sake of unoptimized code.

@Dante-Broggi
Copy link
Contributor

Is this resolved, or no longer valid? If either, this should be closed.

@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
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers IRGen LLVM IR generation
Projects
None yet
Development

No branches or pull requests

2 participants