[llvm] [ReachingDefAnalysis] Extend the analysis to stack objects. (PR #118097)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 18:59:06 PST 2025


================
@@ -525,14 +610,21 @@ MachineInstr *ReachingDefAnalysis::getLocalLiveOutMIDef(MachineBasicBlock *MBB,
                                                         MCRegister Reg) const {
   LiveRegUnits LiveRegs(*TRI);
   LiveRegs.addLiveOuts(*MBB);
-  if (LiveRegs.available(Reg))
+  if (Register::isPhysicalRegister(Reg) && LiveRegs.available(Reg))
     return nullptr;
 
   auto Last = MBB->getLastNonDebugInstr();
   if (Last == MBB->end())
     return nullptr;
 
   int Def = getReachingDef(&*Last, Reg);
+
+  if (Register::isStackSlot(Reg)) {
----------------
michaelmaitland wrote:

This code can be at the very start of this function to avoid any extra work?

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


More information about the llvm-commits mailing list