Open
Description
CodeGen replaces trivial copy constructors and assignment operators with memcpy
. ClangIR intentionally doesn't do so when generating CIR, so that all those function calls are available for analysis: https://godbolt.org/z/xcKdzKaWM. We'd ideally switch to the memcpy at some point before generating LLVM though, to generate better code. One potentially idea would be to tag either the functions themselves or the call sites during CIR generation, and then have a later pass (e.g. LoweringPrepare) do the memcpy conversion. Search for isMemcpyEquivalentSpecialMember
under clang/lib/CodeGen for examples of how it handles this.