[llvm] [AArch64][PAC] Reset `killed` operand flags in outlined functions (PR #221041)
Anatoly Trosinenko via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 2 11:55:04 PDT 2026
================
@@ -958,6 +958,7 @@ MachineFunction *MachineOutliner::createOutlinedFunction(
MachineInstr &NewMI = TII.duplicate(MBB, MBB.end(), MI);
NewMI.dropMemRefs(MF);
NewMI.setDebugLoc(DL);
+ NewMI.clearKillInfo();
----------------
atrosinenko wrote:
Updated, thanks!
I think it would be better to rewrite this as two separate loops: copy the original instructions first and cleanup the copy afterwards, with the second loop iterating over the "flat" instruction list (so that each instruction bundle is seen as `BUNDLE` instruction followed by the contained instructions - using `MachineBasicBlock::instr_iterator` instead of the default `MachineBasicBlock::iterator`). Though, I would rather implement this refactoring in a separate follow-up PR. I guess this should affect `NewMI.dropMemRefs(MF)` as well but this requires further investigation.
https://github.com/llvm/llvm-project/pull/221041
More information about the llvm-commits
mailing list