3 ms·
You can see it get propagated through as a constant at the high level here: https://godbolt.org/z/jxWKcnTT1 https://godbolt.org/z/jxWKcnTT1 That is normal and
by DannyBee 4y ago
You can see it get propagated through as a constant at the high level here:
https://godbolt.org/z/jxWKcnTT1 https://godbolt.org/z/jxWKcnTT1
That is normal and what i would expect to happen.
You can see in lower level RTL dumps, nothing chooses to commonize it.
That seems a bit weird, since it should have a cost model that says this isn't free.
- caf 4y agoI believe it's possible to report this as a "missed optimisation" bug.
- DannyBee 4y agoYes. A lot of the intrinsics also look like (at least in gcc), they are marked always inline but not pure/const. it's probably worthwhile marking those that take memory as pure/const. That way, it's obvious the value is readonly even when it's inlined. (otherwise, the compiler will have to prove it in the inlined code, which is not always possible)