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

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 8 13:36:58 PST 2024


================
@@ -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:

That would be a lot simpler, just need to be sure it doesn't matter anywhere.

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


More information about the llvm-commits mailing list