[llvm] [LiveVariables] Mark use as implicit-def if defined at instr (PR #119446)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 12 03:16:42 PST 2024
================
@@ -277,11 +277,13 @@ void LiveVariables::HandlePhysRegUse(Register Reg, MachineInstr &MI) {
continue;
if (PartDefRegs.count(SubReg))
continue;
+
+ // Check if SubReg is defined at LastPartialDef.
+ bool IsDefinedHere = LastPartialDef->modifiesRegister(SubReg, TRI);
// This part of Reg was defined before the last partial def. It's killed
// here.
- LastPartialDef->addOperand(MachineOperand::CreateReg(SubReg,
- false/*IsDef*/,
- true/*IsImp*/));
+ LastPartialDef->addOperand(
+ MachineOperand::CreateReg(SubReg, IsDefinedHere, true /*IsImp*/));
----------------
arsenm wrote:
Swapping what used to be a use with a def sounds wrong. Do we need multiple implicit operands to model this liveness?
https://github.com/llvm/llvm-project/pull/119446
More information about the llvm-commits
mailing list