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

cmd/compile: non-deterministic build, breaking toolstash -cmp #17288

Closed
mdempsky opened this issue Sep 29, 2016 · 8 comments
Closed

cmd/compile: non-deterministic build, breaking toolstash -cmp #17288

mdempsky opened this issue Sep 29, 2016 · 8 comments
Milestone

Comments

@mdempsky
Copy link
Member

Currently at master you can't do:

./make.bash
toolstash save
go build -a -toolexec='toolstash -cmp' std cmd

because cmd/compile isn't producing deterministic output. This used to work.

It looks like instructions are now being ordered non-deterministically within a basic block. I'll begin a bisect to track down when this regressed.

/cc @randall77 @cherrymui

@bradfitz
Copy link
Contributor

@aclements, is this why your performance numbers were bouncing all over the other day?

@bradfitz bradfitz added this to the Go1.8 milestone Sep 29, 2016
@mdempsky
Copy link
Member Author

bisect identifies CL 29732 (f876fb9).

/cc @cherrymui @dr2chase

@bradfitz
Copy link
Contributor

for c, used := range s.copies {

@aclements
Copy link
Member

@bradfitz, my problem looked like it had to do with spills, but it's possible.

@mdempsky
Copy link
Member Author

Do we make copies of copies? Is it possible that copy A is the only use of copy B, and depending on whether we visit A before B will influence whether we're able to eliminate B?

@cherrymui
Copy link
Member

I thought the order of iteration doesn't matter as it will delete all of them. Well, maybe it is, as deleting one copy may decrement Uses of another.
Will try to fix it tonight.

@mdempsky
Copy link
Member Author

FYI, running that loop until we reach a fixed point seems to solve the non-determinism. I can upload a CL for that if you're interested.

@cherrymui
Copy link
Member

Yes, I am doing this, too. Go ahead and send the CL.

@golang golang locked and limited conversation to collaborators Sep 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants