[PATCH] D119792: [Clang] [P2025] Analyze only potential scopes for NRVO

Evgeny Shulgin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 17 10:24:25 PDT 2022


Izaron added a comment.

In D119792#3389126 <https://reviews.llvm.org/D119792#3389126>, @erichkeane wrote:

> So P2025 <https://reviews.llvm.org/P2025> has not successfully made it through EWG, so this would have to be under a 'flag'.  Also, I believe this will end up being applied to C++23, so it would have to be under a C++23 flag, even when we make it a default behavior.

I felt like this particular patch don't really need to wait until the paper make it to C++XX.

**RVO** (unnamed return value optimization), a simpler optimization, has been used for a very very long time, before they made it mandatory in C++17 (effectively just describing the status quo in the Standard).

The paper contains an exhaustive set of NRVO use-cases. **13** out of **20** cases are already implemented in Clang, and the current patch makes it **17** out of **20**. I could send a patch without mentioning the paper at all, but it would be harder to track progress.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119792/new/

https://reviews.llvm.org/D119792



More information about the cfe-commits mailing list