In ClangIR, we replaced a trivial copy constructor call with cir::CopyOp in the LoweringPrepare pass. cir::CopyOp is already upstreamed, but not used for that case.
Code in ClangIR: https://github.com/llvm/clangir/blob/823e943d1b9aaba0fc46f880c5a6ac8c29fc761d/clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp#L1537-L1550
Ref: #160999 (comment)