Make sure that, for every living SCEV, we have all its direct
operand tracking it as their user.
Details
Diff Detail
Event Timeline
Not 100% sure it should be UniqueSCEVs to iterate on; besides, we don't verify obsolete dangling users so far (at least not before we start dropping them). Ideas for further improvement welcome.
I think it's the right one. This is a property which should hold for all SCEVs. We'll miss stale unknowns (since they're removed from that set), but that's okay because they have no operands.
besides, we don't verify obsolete dangling users so far (at least not before we start dropping them)
I have no idea what you mean by this. Expand?
I'd LGTM this except for open question above. I'm concerned I'm missing something.
llvm/lib/Analysis/ScalarEvolution.cpp | ||
---|---|---|
12918 | This code exists in at least one other place (getDefiningScopeBound). I'm fine with this landing as is, but we should probably start thinking about how to abstract user and operand walks. | |
12931 | Minor: Can you make the normal case an early continue to reduce nesting? |
I have no idea what you mean by this. Expand?
Never mind, I confused myself thinking that we'd remove dependencies of SCEVs on forget, but we never do it actually. So it should never be the case.
llvm/lib/Analysis/ScalarEvolution.cpp | ||
---|---|---|
12918 | Will see if I can follow-up with factoring out this common part. |
llvm/lib/Analysis/ScalarEvolution.cpp | ||
---|---|---|
12918 |
This code exists in at least one other place (getDefiningScopeBound). I'm fine with this landing as is, but we should probably start thinking about how to abstract user and operand walks.