Page MenuHomePhabricator

Add builtin trait for add/remove cv (and similar)
Needs ReviewPublic

Authored by zoecarver on Sep 14 2019, 10:42 AM.

Details

Summary

This patch adds six builtins: __remove_cv, __remove_cosnt, __remove_volatile, __add_cv, __add_const, and __add_volatile. I have added two stress tests to show the performace improvements. The __remove_cv test sees a 160% build time imporvement while the __add_cv test sees an 8% improvement.

This patch is based on D67052.

I will submit a patch for implementing these in libc++ after this lands.

Diff Detail

Event Timeline

zoecarver created this revision.
  • diff from D67052, not master
Harbormaster completed remote builds in B38138: Diff 220226.

Generate diff based on D67052 (arc wasn't working so I had to do it manually this time).

The __remove_cv test sees a 160% build time imporvement while the __add_cv test sees an 8% improvement.

Those numbers are specifically for those macrobenchmarks, right?
What impact does this have on some real-world code?
I'm just curious as to cost/benefit here.

@lebedev.ri after adding _only_ these builtins to libc++ the type trait tests run several seconds faster. I think if we update _all_ the type traits to use builtins then, it could increase speed of the type trait tests by as much as 50% (if not more).