We're not changing IR while running a single MemDep query, so it's safe to cache alias analysis results using BatchAA. This adds BatchAA usage to getSimplePointerDependencyFrom(), which is non-intrusive -- covering larger parts (like a whole processNonLocalLoad query) it also possible, but requires threading BatchAA through a bunch of APIs.
For the ThinLTO configuration, this is a 1% geomean improvement on CTMark: https://llvm-compile-time-tracker.com/compare.php?from=f22ac1d15b1b3c8e890cad4aa126a8239bec61f7&to=3b8dfc926fb695c44c31fddf675a86ee55cba941&stat=instructions
Add comment on why using BatchAA and caching AA results is valid (no IR changes).