-
Notifications
You must be signed in to change notification settings - Fork 265
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
Byte extract and extract bits can be constant #7331
Byte extract and extract bits can be constant #7331
Conversation
Codecov ReportBase: 78.34% // Head: 78.33% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #7331 +/- ##
===========================================
- Coverage 78.34% 78.33% -0.01%
===========================================
Files 1644 1645 +1
Lines 190313 190392 +79
===========================================
+ Hits 149097 149153 +56
- Misses 41216 41239 +23
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I'd be curious in which cases these are "considered constant" but not simplified to proper constants? |
The case motivating this is turning a pointer into a sequence of bytes (as happens with |
Independently, |
0aa571a
to
ded48a5
Compare
When all operands are constants and the extract is fully within bounds of the source object then the result is constant. This permits constant-propagating byte-extract operations from pointers that are address-of.
ded48a5
to
2ba7118
Compare
With diffblue#7331 in combination with earlier changes to the simplifier the left-hand side instance to check for now has a different SSA index. As diffblue#7331 was not rebased on top of the simplifier changes, this went unnoticed.
When all operands are constants and the extract is fully within bounds of the source object then the result is constant.