-
Notifications
You must be signed in to change notification settings - Fork 543
[tools] Make the dead code removal optimizer correctly handle unconditional branches. #23107
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
Conversation
…tional branches. Wehn handling an unconditional branch, we need to mark all the instructions until the end of the method, not only until the end of block that is currently being processed. This fixes a problem where the dead code optimizer would optimize away code after an unconditonal branch, ending up with invalid IL because code that wasn't optimized away would have branches into the removed code.
✅ API diff for current PR / commit.NET ( No breaking changes )✅ API diff vs stable.NET ( No breaking changes )ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
✅ [CI Build #b001864] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #b001864] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #b001864] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #b001864] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #b001864] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #b001864] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 121 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
When handling an unconditional branch, we need to mark all the instructions
until the end of the method, not only until the end of block that is currently
being processed.
This fixes a problem where the dead code optimizer would optimize away code
after an unconditonal branch, ending up with invalid IL because code that
wasn't optimized away would have branches into the removed code.