llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.24k stars 11.66k forks source link

Proposal for a perf-related diagnostic #95480

Open nickitat opened 3 months ago

nickitat commented 3 months ago

Hi!

The idea is to provide (likely opt-in) switch to enable diagnostic of the following case: https://cppinsights.io/s/01568d5e. Specifically I'm talking about implicit copy of a when calling foo.

I'm not sure where it is better to be implemented. As a part of compiler or probably clang-tidy. Because in most of the cases people would be fine with this copying, it is definitely not something as generic as unaligned atomic access for example. Ideally something like perfsan )

llvmbot commented 3 months ago

@llvm/issue-subscribers-clang-tidy

Author: Nikita Taranov (nickitat)

Hi! The idea is to provide (likely opt-in) switch to enable diagnostic of the following case: https://cppinsights.io/s/01568d5e. Specifically I'm talking about implicit copy of `a` when calling `foo`. I'm not sure where it is better to be implemented. As a part of compiler or probably clang-tidy. Because in most of the cases people would be fine with this copying, it is definitely not something as generic as unaligned atomic access for example. Ideally something like perfsan )