[llvm] [RISCV][TII] Add and use new hook to optimize/canonicalize instructions after MachineCopyPropagation (PR #137973)
    Craig Topper via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue May  6 22:25:56 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);
----------------
topperc wrote:
Do we need to set `Changed = true` here or is guaranteed it was already set earlier?
https://github.com/llvm/llvm-project/pull/137973
    
    
More information about the llvm-commits
mailing list