Skip to content

[opt] remove trivially dead instructions in mandatory combine #30429

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

Conversation

zoecarver
Copy link
Contributor

Except for all the test changes, this patch should be very simple. When mandatory combine iterates over all instructions it already checks if they're trivially dead. Now, if they are trivially dead, they will be erased.

@zoecarver zoecarver requested a review from gottesmm March 16, 2020 17:44
@zoecarver
Copy link
Contributor Author

@gottesmm when updating these tests I sometimes skipped the mandatory combine pass and sometimes added uses. I only skipped the pass when I thought that the test had absolutely nothing to do with mandatory combine. The only exception is in Serialization. I think mandatory combine should run for those two serialization tests but, I was having trouble generating uses for all the function_refs. Any suggestions on good "dummy" uses for those?

@zoecarver
Copy link
Contributor Author

@gottesmm ping.

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test

@zoecarver zoecarver force-pushed the optimize/remove-dead-in-mand-combine branch from e98bbc5 to dfa472d Compare April 14, 2020 01:29
@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test and merge

1 similar comment
@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test and merge

@gottesmm
Copy link
Contributor

@zoecarver given that you are hitting failures, lets do a full test on this.

@gottesmm
Copy link
Contributor

We should also run the device filecheck tests to make sure you didn't miss anything. @shahmishal you said we could do that via a bot now, right?

@zoecarver
Copy link
Contributor Author

I suspect those were added/modified since I last updated this PR. I'll build from TOT and fix those now.

@gottesmm
Copy link
Contributor

Ok. But yea, please do a full test and also we need to do a preset test to test that the file check device tests aren't broken by this.

@zoecarver
Copy link
Contributor Author

@gottesmm will do. I'll try to run those tests tonight and fix whatever errors arise.

@zoecarver zoecarver force-pushed the optimize/remove-dead-in-mand-combine branch from dfa472d to fd39d81 Compare April 14, 2020 03:46
@zoecarver
Copy link
Contributor Author

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e98bbc5b55a72b7f0bccc8a33553f8655aa78445

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e98bbc5b55a72b7f0bccc8a33553f8655aa78445

@zoecarver
Copy link
Contributor Author

@swift-ci please test source compatibility

@zoecarver
Copy link
Contributor Author

@gottesmm I think that's the device filecheck tests that you were talking about.

@zoecarver
Copy link
Contributor Author

@swift-ci please test source compatibility

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test OS X platform

@zoecarver
Copy link
Contributor Author

@swift-ci Please smoke test OS X platform

@zoecarver
Copy link
Contributor Author

zoecarver commented Apr 14, 2020

The Debug build failed because of this error:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/stdlib.h:61:10: fatal error: cannot open file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk/usr/include/Availability.h': Operation not permitted
23:16:49 #include <Availability.h>
23:16:49          ^
23:16:49 1 error generated.

It doesn't look like that's because of this patch. Should I re-trigger the bots or is the Release build good enough?

@gottesmm
Copy link
Contributor

@swift-ci test windows platform

@gottesmm
Copy link
Contributor

preset=buildbot,tools=RA,stdlib=RD,test=non_executable
@swift-ci Please test with preset macOS

@gottesmm
Copy link
Contributor

preset=buildbot,tools=RA,stdlib=RD,test=non_executable
@swift-ci Please test with preset macOS

@CodaFi
Copy link
Contributor

CodaFi commented Apr 15, 2020

Possible that the debug source compat builder ran out of space

@swift-ci test Source Compatibility Debug

@zoecarver
Copy link
Contributor Author

The preset build failed because of #31022 but also had another error. I'll fix the other failing test tonight then build the preset.

Failing tests that do not test mandatory combine are updated to skip
the mandatory combine pass. Othere tests are updated to use otherwise
removed values.
@zoecarver zoecarver force-pushed the optimize/remove-dead-in-mand-combine branch from fd39d81 to 4cc98f0 Compare April 15, 2020 06:39
@zoecarver
Copy link
Contributor Author

preset=buildbot,tools=RA,stdlib=RD,test=non_executable
@swift-ci Please test with preset macOS

@zoecarver
Copy link
Contributor Author

@swift-ci please test

@zoecarver
Copy link
Contributor Author

preset=buildbot,tools=RA,stdlib=RD,test=non_executable
@swift-ci please test with preset macOS

@zoecarver
Copy link
Contributor Author

@swift-ci please test

@zoecarver
Copy link
Contributor Author

@swift-ci please test windows platform

@zoecarver
Copy link
Contributor Author

Looks like the enum stuff is failing on windows on master too.

@theblixguy
Copy link
Collaborator

Should be fixed by #31040

@zoecarver
Copy link
Contributor Author

@gottesmm let me know if this looks good to you and I'll merge it.

@CodaFi
Copy link
Contributor

CodaFi commented Apr 15, 2020

@swift-ci test Windows

@gottesmm
Copy link
Contributor

@zoecarver thanks for jumping through the hoops!

@gottesmm gottesmm merged commit 6998ad9 into swiftlang:master Apr 15, 2020
@zoecarver
Copy link
Contributor Author

Of course. Thanks for reviewing :)

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.

5 participants