As mentioned at the MSSA roundtable, LICM spends a lot of time construction an AST, despite the caps already in place. This patch is a proposal on how to reduce the impact.
The idea here is pretty simple: We're only interested in must-alias mod sets of loop invariant pointers. As such, only populate the AST with loop-invariant loads and stores (anything else is definitely not promotable) and then discard any sets with alias with any of the remaining, definitely non-promotable accesses.
If we promoted something, check whether this has made some other accesses loop invariant and thus possible promotion candidates.
This has a large positive compile-time impact: https://llvm-compile-time-tracker.com/compare.php?from=d7186fe3710828fab03de69f78f01f001d70e1aa&to=264016756045aba11ae326bfab6a632bc5ef1855&stat=instructions We save ~2% geomean at O3, and lencod in particular saves 6%.
There is no impact on the number of promotions (licm.NumPromoted) in test-suite with this change.