llvm-project
llvm-project copied to clipboard
[clang][dataflow] Analysis misses Widen calls when there are goto backedges
In the clang dataflow framework, we currently call widenTypeErased when isBackedgeNode, but isBackedgeNode only considers CFG nodes with a loop target. It misses backedges formed by goto (we see this in some examples like mysql mf_keycache.cc). If Widen is important for termination, this could lead to iterating until the analysis reaches the MaxBlockVisits, which is much much longer than if the analysis is able to Widen.
I have tried adding some simple backedge detection to augment the isBackedgeNode and seen reduction of hangs (e.g., in mf_keycache.cc).