Though we request users implementing join to return a meaningful
LatticeJoinEffect, we never use the returned value. Requiring users
(and the framework) to continue calculating an unused value adds
unnecessary complexity.
Details
- Reviewers
ymandel NoQ xazax.hun gribozavr2
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Returning whether the lattice was changed can be a nice optimization when comparing lattice elements is expensive. On the other hand, it can be one more source of errors. I am fine with either approach, both can make sense depending on whether the goal is to make the interface easier to use or to have superb performance.
Agreed and the performance consideration was the original motivation. But, then we never used it! Indeed, we'd have to rework the worklist algorithm to make use of return value so that, for each block, it saved the state immediately before the block (that is, after the join from incoming branches). Currently, we only save the state *after* the block.
That's why I suggested to Eric that we should remove it. We can revisit in the future: if it seems a valuable source of performance improvement, we can consider how best to modify the system at that point.