[llvm] [MachineCSE] Enhance MachineCSE simple PRE to find common subexpressi… (PR #129860)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 6 19:14:08 PST 2025


================
@@ -887,6 +887,23 @@ bool MachineCSEImpl::ProcessBlockPRE(MachineDominatorTree *DT,
         NewMI.setDebugLoc(EmptyDL);
 
         NewMI.getOperand(0).setReg(NewReg);
+        for (MachineOperand &MO :
----------------
emelliu wrote:

Maybe another simple solution is that put 
```
  ChangedPRE = PerformSimplePRE(DT);
  ChangedCSE = PerformCSE(DT->getRootNode());
```
in a do-while loop, stop until no changed.

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


More information about the llvm-commits mailing list