[PATCH] D122121: [clang][dataflow] Add action caching support to MatchSwitch

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. In D122121#3396688 , @xazax.hun wrote: > Thanks! Did you have a chance whether this makes a difference in real world > scenarios? I'm mostly curious because I do not have a good mental model of > how the matchers are implemented

[PATCH] D122121: [clang][dataflow] Add action caching support to MatchSwitch

2022-03-21 Thread Gábor Horváth via Phabricator via cfe-commits
xazax.hun accepted this revision. xazax.hun added a comment. Thanks! Did you have a chance whether this makes a difference in real world scenarios? I'm mostly curious because I do not have a good mental model of how the matchers are implemented, specifically what optimizations are in place, so

[PATCH] D122121: [clang][dataflow] Add action caching support to MatchSwitch

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel accepted this revision. ymandel added a comment. This revision is now accepted and ready to land. Much clearer now, thanks for the changes! The only real question I have is what's the best design for the cache -- lambda or explicit pair. I leave it up to you. In D122121#3396096

[PATCH] D122121: [clang][dataflow] Add action caching support to MatchSwitch

2022-03-21 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev marked an inline comment as done. sgatev added a comment. In D122121#3396022 , @ymandel wrote: > What is the motivation for stashing the results of a match on a statement? Do > we expect to encounter the same statement often? The matcher is evalu

[PATCH] D122121: [clang][dataflow] Add action caching support to MatchSwitch

2022-03-21 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev updated this revision to Diff 416906. sgatev added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122121/new/ https://reviews.llvm.org/D122121 Files: clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h c

[PATCH] D122121: [clang][dataflow] Add action caching support to MatchSwitch

2022-03-21 Thread Yitzhak Mandelbaum via Phabricator via cfe-commits
ymandel added a comment. What is the motivation for stashing the results of a match on a statement? Do we expect to encounter the same statement often? I thought the concern was more specific to re-matching particular types, like `std::optional`. For that, we could lazily store the declaration

[PATCH] D122121: [clang][dataflow] Add action caching support to MatchSwitch

2022-03-21 Thread Stanislav Gatev via Phabricator via cfe-commits
sgatev created this revision. sgatev added reviewers: ymandel, xazax.hun, gribozavr2. Herald added subscribers: tschuett, steakhal, rnkovacs. Herald added a project: All. sgatev requested review of this revision. Herald added a project: clang. Enable default caching of actionsin `MatchSwitch` so t