[PATCH] D98659: [MachineCopyPropagation] Do more backward copy propagations

yshui via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 18:39:41 PDT 2021


yshui added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineCopyPropagation.cpp:283-284
 
-  MachineInstr *findAvailBackwardCopy(MachineInstr &I, MCRegister Reg,
-                                      const TargetRegisterInfo &TRI) {
+  std::pair<MachineInstr *, SmallVector<MachineInstr *>>
+  findAvailBackwardCopy(MachineInstr &I, MCRegister Reg,
+                        const TargetRegisterInfo &TRI) {
----------------
jmorse wrote:
> Performance nit -- is it safe to return a `SmallVector *` in the pair? That avoids needless copying and potential allocations.
I don't see a problem with this. Will update.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98659



More information about the llvm-commits mailing list