-
Notifications
You must be signed in to change notification settings - Fork 269
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
Evaluate __builtin_ffs{,l,ll} over constants at compile time #5740
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but...
- Do we have any tests for what happens when it is not a compile-time constant?
- Given that this has quite a few a few friends that need to be (partially, constant only, etc.) evaluated before / during type checking, is it time to start thinking about an abstraction / pass / organisation of these?
Codecov ReportBase: 77.87% // Head: 77.84% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #5740 +/- ##
===========================================
- Coverage 77.87% 77.84% -0.04%
===========================================
Files 1576 1571 -5
Lines 181824 180544 -1280
===========================================
- Hits 141598 140547 -1051
+ Misses 40226 39997 -229
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. |
We do - the existing regression test (in which the constant cases have now been turned into
Fair point. One way of doing this is introducing |
I like the idea of the simplifier doing this because that way it can be used elsewhere, constant folded during symex, checked during trace construction, etc. Not entirely sure each one needs an |
3c41387
to
f5b4098
Compare
f5b4098
to
72db0e9
Compare
This is now built on top of #5879, introducing a new |
72db0e9
to
9f43ab9
Compare
4520385
to
4d6947d
Compare
4d6947d
to
71b283d
Compare
71b283d
to
5eff777
Compare
01943d5
to
d7bde5f
Compare
99b3c5b
to
342c217
Compare
342c217
to
d5f1b3e
Compare
d5f1b3e
to
9d072ba
Compare
Rather than ad-hoc handling __builtin_ffs (and its variants) in the C front-end, make find-first-set available across the code base.
9d072ba
to
e13e360
Compare
GCC evaluates this built-in at compile time, and the Linux kernel
assumes this is the case.