[PATCH] D118591: [Function Specialisation] Fix use after free

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 01:33:33 PST 2022


SjoerdMeijer added a comment.

Agreed, lazily removing the instructions in this way is what I was expecting.

But this is a bit odd, a.k.a. not what I was expecting:

> None of the existing tests actually covers this code path I am afraid.

Do you mean this:

  if (I->isSafeToRemove()) {
     I->eraseFromParent();
     Solver.removeLatticeValueFor(I);
   }

Only triggers in the reproducer attached to the bugreport and not in the regression tests? I think we should first try hard to get a test for that, which I hope is doable. Otherwise, we might as well remove this code and rely on later clean up passes to delete dead code which I think is a valid strategy and alternative if it makes things really complicated here. But again, better would be to see if we can trigger this and a test for it.


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

https://reviews.llvm.org/D118591



More information about the llvm-commits mailing list