[llvm] [RISCV][TII] Add and use new hook to optimize/canonicalize instructions after MachineCopyPropagation (PR #137973)

Alex Bradbury via llvm-commits llvm-commits at lists.llvm.org
Tue May 6 06:55:48 PDT 2025


================
@@ -870,6 +870,11 @@ void MachineCopyPropagation::forwardUses(MachineInstr &MI) {
     ++NumCopyForwards;
     Changed = true;
   }
+  // Attempt to canonicalize/optimize the instruction now its arguments have
+  // been mutated.
+  if (TII->optimizeInstruction(MI)) {
+    LLVM_DEBUG(dbgs() << "MCP: After optimizeInstruction: " << MI << "\n");
----------------
asb wrote:

Thanks, fixed

https://github.com/llvm/llvm-project/pull/137973


More information about the llvm-commits mailing list