[PATCH] D154307: [InstructionSimplify] Avoid simplifying ICmp without parent

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 2 14:28:52 PDT 2023


nikic added a reviewer: fhahn.
nikic added a comment.

I believe this is related to the "phi of op" feature in NewGVN: https://github.com/llvm/llvm-project/blob/6954cb54252b50df95eea05c513e739b3ad2c8a0/llvm/lib/Transforms/Scalar/NewGVN.cpp#L2767 These cloned instructions won't have a parent.

I'm not entirely sure what to do here. I don't think that this fix is sufficient: If we need support for instructions without parent for NewGVN, then we need to revert @arsenm's change entirely, not just this part. Alternatively we need a different way to handle this on the NewGVN side. It may be possible to insert the instructions, as long as we are sure to later remove them again. I'm not sure if this would cause problems with NewGVNs design though, which is not supposed to do IR modifications during the analysis phase.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154307



More information about the llvm-commits mailing list