This is an archive of the discontinued LLVM Phabricator instance.

[AST] Pack CXXDependentScopeMemberExpr
ClosedPublic

Authored by riccibruno on Jan 6 2019, 3:05 PM.

Details

Summary

Use the newly available space in the bit-fields of Stmt. Additionally store FirstQualifierFoundInScope
as a trailing object since it is most of the time null (non-null for 2 of the 35446 CXXDependentScopeMemberExpr
when parsing all of Boost).

It would be possible to move the data for the nested-name-specifier to a trailing object too to save
another 2 pointers, however doing so did actually regress the time taken to parse all of Boost slightly.

This saves 8 bytes + 1 pointer per CXXDependentScopeMemberExpr in the vast majority of cases.

Diff Detail

Repository
rC Clang

Event Timeline

riccibruno created this revision.Jan 6 2019, 3:05 PM

Does the regression disappear if you make the scope specifier the first trailing object? Later trailing objects are more expensive to access, and I would imagine that the scope specifier and template arguments are more important than the other fields.

Does the regression disappear if you make the scope specifier the first trailing object? Later trailing objects are more expensive to access, and I would imagine that the scope specifier and template arguments are more important than the other fields.

That was with the scope specifier first. I would imagine that putting it last would be indeed be more expensive.
I can leave a TODO here saying that it could be in principle be stored as a trailing object, but the that the run-time effect
of doing so should be investigated.

Okay. That comment seems reasonable. Glad to hear you're on top of it. :)

Okay. That comment seems reasonable. Glad to hear you're on top of it. :)

I guess that means I can land this as is ?

rjmccall accepted this revision.Jan 7 2019, 11:10 PM

Yeah, LGTM.

This revision is now accepted and ready to land.Jan 7 2019, 11:10 PM
This revision was automatically updated to reflect the committed changes.