On 2023-06-13 17:18, Jiufu Guo via Gcc-patches wrote:
Hi David,
Thanks for your valuable comments!
David Edelsohn <dje....@gmail.com> writes:
...
Do you have any measurement of how expensive it is to test all of
these additional methods to generate a constant? How much does this
affect the
compile time?
Yeap, Thanks for this very good question!
This patch is mostly using bitwise operations and if-conditions,
it would be expected not expensive.
Testcases were checked. For example:
A case with ~1000 constants: most of them hit this feature.
With this feature, the compiling time is slightly faster.
0m1.985s(without patch) vs. 0m1.874s(with patch)
(note:D rs6000_emit_set_long_const does not occur in hot perf
functions. So, the tricky time saving would not directly cause
by this feature.)
A case with ~1000 constants:(most are not hit by this feature)
0m2.493s(without patch) vs. 0m2.558s(with patch).
Typo, this should be:
0m2.493s(with patch) vs. 0m2.558s(without patch).
It is also faster with the patch :)
BR,
Jeff (Jiufu Guo)
For runtime, actually, with the patch, it seems there is no visible
improvement in SPEC2017. While I still feel this patch is
doing the right thing: use fewer instructions to build the constant.
BR,
Jeff (Jiufu Guo)
Thanks, David