[GlobalOpt] Preserve CFG analyses
authorArthur Eubanks <aeubanks@google.com>
Sun, 19 Jun 2022 19:20:11 +0000 (12:20 -0700)
committerArthur Eubanks <aeubanks@google.com>
Sun, 19 Jun 2022 23:13:02 +0000 (16:13 -0700)
commitcc65f3e167144c39ef9ca3a69c3148b71dcab496
tree634b5e94108818384e2e5822bf801b81bbbdfe5a
parent314dbde12cd2ae2809cbba6de0504b034a289a40
[GlobalOpt] Preserve CFG analyses

The only place we modify the CFG is when calling
removeUnreachableBlocks(), so insert a callback there which invalidates
analyses for that function (or recomputes DT in the legacy PM).

Small compile time wins across the board:
https://llvm-compile-time-tracker.com/compare.php?from=f444ea8ce0aaaa5ec1a4129809389da15cc41396&to=698f41f4fc26cbf1006ed5d88e9d658edfc5b749&stat=instructions

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D128145
llvm/lib/Transforms/IPO/GlobalOpt.cpp