[PATCH] D123394: [CodeGen] Late cleanup of redundant address/immediate definitions.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 08:45:39 PDT 2022


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/PrologEpilogInserter.cpp:1514
+// Slow version for now: Update live-in lists and clear kill flags after each
+// removal of a redundant definition. Not sure how important kill-flags are
+// after PEI, but this clears them carefully on each user. TODO: This should
----------------
jonpa wrote:
> arsenm wrote:
> > If PEI's loop was reversed and scavenge register backwards was used, we wouldn't need kill flags at all
> Thanks for review. That is a good point, but I have discovered that not only address anchors from Frame Indices lowering that can be found redundant and cleaned, but also many (more) immediate loads. So changing PEI would not handle all cases, unfortunately.
> 
> I have asked before here if this should be part of PEI or become a separate pass, but so far we have not agreed on anything. Given the above, it seems to me now more reasonable to have this as a separate pass run before MachineCopyPropagation. Does this make sense to you?
> 
> 
I think PEI should be split into a number of separate passes as it is. It might make sense to keep it in PEI if you were to do something ahead of or as part of the frame finalization (which might be better than looking for references to getFrameRegister)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123394/new/

https://reviews.llvm.org/D123394



More information about the llvm-commits mailing list