[PATCH] D91711: SCEV add function to see if SCEVUnknown is null
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 26 18:31:53 PST 2020
reames added a comment.
Skimming the review and discussion, I think this patch is moving in the wrong direction. The basic issue appears to be that a pass is holding on to the result of an analysis after mutating the IR without appropriately updating the cached information. That's a bug for any analysis, not just SCEV. Say you held a pointer to a Loop object and then broke the backedge in the IR; that's a bug. I will admit that the existing SCEV code appears to support some mutation of the IR, but replace all uses with is different from true deletion.
Purely from the discussion in this bug (i.e. I haven't studied the code of the other patch), it sounds like the debug info salvaging described is wrong and needs reverted.
If I understand what that patch is doing (as described here), you might be able to get the same effect by computing the set of equivalent values before rewriting, hang onto the IR Values with a ValueHandle to detect deletion, and then rewrite.
The other option would be just to treat debug info uses as first class uses during LSR rewriting.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the llvm-commits