[PATCH] D125335: Pass lamba to MachineCopyProp to determine which MI is treated as Copy instruction.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 13:45:17 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineCopyPropagation.cpp:298
+    if (UseCopyInstr || EnableCopyInstr) {
+      PredicateCopy = [](const MachineInstr &MI) {
+        const TargetInstrInfo *TII = MI.getMF()->getSubtarget().getInstrInfo();
----------------
craig.topper wrote:
> Why do you need a lambda inside the pass? Can't you pass around the bool and TII? And have a static function that takes MI, TII, and the bool and does the right thing?
Or make more of the static functions in the pass, member functions so you don't have to pass around TII and the bool/predicate.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125335



More information about the llvm-commits mailing list