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

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 30 15:11:56 PDT 2025


================
@@ -867,6 +867,12 @@ void MachineCopyPropagation::forwardUses(MachineInstr &MI) {
          make_range(Copy->getIterator(), std::next(MI.getIterator())))
       KMI.clearRegisterKills(CopySrcReg, TRI);
 
+    // Attempt to canonicalize/optimize the instruction now its arguments have
----------------
preames wrote:

The placement here is unsound.  You're in a loop which is operating over the instructions operands!

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


More information about the llvm-commits mailing list