[llvm] [CodeGen] Preserve LiveStack analysis in StackSlotColoring pass (PR #94967)

Vikash Gupta via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 01:13:18 PDT 2024


================
@@ -534,6 +535,12 @@ bool StackSlotColoring::runOnMachineFunction(MachineFunction &MF) {
   InitializeSlots();
   Changed = ColorSlots(MF);
 
+  // Clear LiveStack analysis as it has been changed in ways that it requires
+  // efforts to rectify  which is equivalent to do it all over again. Also,
+  // this current results would not be used later, so better to clear it &
+  // preserve analysis.
+  LS->releaseMemory();
----------------
vg0204 wrote:

But, currently LiveStack analysis really is doing nothing just creating a empty shell result, & real work is happening at RA to compute and update livestack result. Also, once generated at RA pass, spill entries in LS will later be used at stackSlotColoring pass, followed by not being used ever again (LS later be used during SCC pass coming after later RA passes, but at that point RA is concerned with newly introduced spill records in LS by itself). So, my point is that preserving LS won't help out in any way. And LS analyis itself is doing no computation, so its re-occurence should not have impact on performance. 

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


More information about the llvm-commits mailing list