Rewrite NRVO determination. Track NRVO candidates on the parser Scope and apply…

Press ? to show keyboard shortcuts.
Committed
nicholasMay 2 2014, 5:41 PM
Parents
rL207889: MS ABI x64: Pass small objects with dtors but no copy ctors directly
Branches
Unknown
Tags
Unknown
Subscribers
None
Description

Rewrite NRVO determination. Track NRVO candidates on the parser Scope and apply the NRVO candidate flag to all possible NRVO candidates here, and remove the flags in computeNRVO or upon template instantiation. A variable now has NRVO applied if and only if every return statement in that scope returns that variable. This is nearly optimal.

Performs NRVO roughly 7% more often in a bootstrap build of clang. Patch co-authored by Richard Smith.

rL207890

cfe/trunk/include/clang/Sema/Scope.h

Loading...

cfe/trunk/include/clang/Sema/Sema.h

Loading...

cfe/trunk/lib/Parse/ParseStmt.cpp

Loading...

cfe/trunk/lib/Parse/Parser.cpp

Loading...

cfe/trunk/lib/Sema/Scope.cpp

Loading...

cfe/trunk/lib/Sema/SemaDecl.cpp

Loading...

cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Loading...

cfe/trunk/lib/Sema/SemaStmt.cpp

Loading...

cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp

Loading...

cfe/trunk/lib/Sema/TreeTransform.h

Loading...

cfe/trunk/test/CodeGenCXX/nrvo.cpp

Loading...

Add Comment