This is an archive of the discontinued LLVM Phabricator instance.

Add basic_string::__assign_str_noalias_external(const value_type* s, size_type n)
AbandonedPublic

Authored by mvels on Jan 18 2020, 2:06 PM.

Details

Summary

This change introduces the __assign_str_noalias_external which is invoked on the slow path from basic_string::operator=(const basic_string&) if either of the strings is a long string..

__string_assign_str_noalias_external is optimized for being called from the operator= method: no alias into this, input has terminating zero as s[n], and size does not exceed max size. The branch in the external instantiated code should be well predicted.

This change explicitly does not change the existing template instantiation for stable, and limits itself to have the new method always externally instantiated. Future changes will include removing operator=(const basic_string&) from the unstable ABI and allowing it to be inlined.

Event Timeline

mvels created this revision.Jan 18 2020, 2:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2020, 2:06 PM
mvels added a comment.Jan 18 2020, 2:09 PM

Eric, let me know if this follows the intended explicit ABI versioned changes.

mvels edited the summary of this revision. (Show Details)Jan 18 2020, 2:10 PM
mvels abandoned this revision.Feb 26 2020, 1:00 PM