[llvm] [MachineLateInstrsCleanup] Handle multiple kills for a preceding definition. (PR #119132)

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 11:33:15 PST 2025


================
@@ -225,8 +231,8 @@ bool MachineLateInstrsCleanup::processBlock(MachineBasicBlock *MBB) {
         MBBDefs.erase(Reg);
         MBBKills.erase(Reg);
       } else if (MI.findRegisterUseOperandIdx(Reg, TRI, true /*isKill*/) != -1)
-        // Keep track of register kills.
-        MBBKills[Reg] = &MI;
+        // Keep track of all instructions that fully or partially kills Reg.
+        MBBKills[Reg].push_back(&MI);
----------------
JonPsson1 wrote:

I think this has to be done per my previous experiments and comments from Dec 10 - there are many failures if I do this. It seems best to me to take care of the kill flags properly here at this moment until other passes are not dependent on them. (What I did on Dec 10 was to remove all kill flags that were affected by the pass, but now I am thinking maybe you meant to only remove those more rare kill flags of the super-register that this patch handles?)

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


More information about the llvm-commits mailing list