[llvm] [RISCV][TII] Add and use new hook to optimize/canonicalize instructions after MachineCopyPropagation (PR #137973)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu May 1 09:20:37 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");
----------------
arsenm wrote:
```suggestion
LLVM_DEBUG(dbgs() << "MCP: After optimizeInstruction: " << MI);
```
Redundant newline
https://github.com/llvm/llvm-project/pull/137973
More information about the llvm-commits
mailing list