Skip to content

[CastOptimizer] Set the correct debug scope for the SILBuilder. #25490

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 1 commit into from
Jun 15, 2019

Conversation

dcci
Copy link
Member

@dcci dcci commented Jun 14, 2019

rdar://problem/48887384

@dcci
Copy link
Member Author

dcci commented Jun 14, 2019

Fixes (another) verification failure.

@dcci
Copy link
Member Author

dcci commented Jun 14, 2019

@swift-ci please test

@gottesmm
Copy link
Contributor

LGTM. We should rename SILBuilder to something else and make SILBuilderWithScope, SILBuilder.

@adrian-prantl
Copy link
Contributor

We should rename SILBuilder to something else and make SILBuilderWithScope, SILBuilder.

Perhaps, but it's difficult. @vedantk and I thought a lot about this in the past and identified at least three common and very different use-cases for SILBuilders, including generating new code from AST, expanding one SIL instruction into many, moving SIL instructions, inlining, ... all have different needs. Originally we thought that we could introduce an Expanding/Moving/GeneratingSILBuilder but we couldn't settle on a design that looked right. I agree that we should revisit that.

@gottesmm
Copy link
Contributor

@adrian-prantl I disagree with that strongly. We should fix this now if possible. It is creating bugs /today/.

My feeling is that unless someone is in SILGen, they should be using SILBuilderWithScope. Why not take advantage of that to hide the original SILBuilder from the SILOptimizer. I already in a previous commit (that I just discovered Slava reverted for some reason, I pinged him about it) created a specific SILBuilder for SILGen. We could have a SILBuilderBase that has the common APIs in between GenSILBuilder and OptSILBuilder. Your thoughts?

@gottesmm
Copy link
Contributor

@adrian-prantl My memory was actually wrong, we still have the SILGenBuilder in SILGen. We could put the special SILGen APIs on that.

@dcci
Copy link
Member Author

dcci commented Jun 15, 2019

As the person involved in fixing (way too many) of these bugs, my opinion is that delaying this refactoring is becoming an increasing burden, so I agree with @gottesmm here.

@benlangmuir
Copy link
Contributor

This broke in CI: https://ci.swift.org/job/oss-swift_tools-RA_stdlib-DA_test-simulator/687/

test/SILOptimizer/castoptimizer-wrongscope.swift:8:16: error: CHECK-NEXT: expected string not found in input
15:54:57 // CHECK-NEXT: copy_addr [take] %8 to [initialization] %66 : $*Float, loc {{.*}}, scope 2

rdar://problem/51804780

I'm going to revert: #25512

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