[PATCH] D154205: [MachineLICM] Handle subloops

JinGu Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 02:43:10 PDT 2023


jaykang10 added a comment.

In D154205#4647254 <https://reviews.llvm.org/D154205#4647254>, @dmgreen wrote:

> I think it would still be invalid to access MI.getParent if MI has been erased. It would be a use after delete.

You are right. I was confused with `remove` which sets its parent nullptr... I am not sure how we can check the erased MI...

> From looking at the old logic it appeared to run UpdateRegPressure only if Hoist was false. Can we do the same thing here?

I am not sure why the original code did not update the register pressure with the hoisted loop invariant code... I think this pass needs to update the register pressure with the loop invariant code, which is hoisted to preheader, because preheader dominates the blocks in the loop and the invariant code makes a live out of preheader. I could miss something...


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

https://reviews.llvm.org/D154205



More information about the llvm-commits mailing list