[clang] Teardown new PM data structures before running codegen pipeline
authorArthur Eubanks <aeubanks@google.com>
Mon, 11 Oct 2021 20:29:58 +0000 (13:29 -0700)
committerArthur Eubanks <aeubanks@google.com>
Tue, 12 Oct 2021 21:17:11 +0000 (14:17 -0700)
commit2cadef6537b351cc696e2de1f5c8e9fbe6055980
treeece69ee8a584a9de479f993944fc4ace9da3efea
parentd402fb02b92a235a2654727908f5211185c538f9
[clang] Teardown new PM data structures before running codegen pipeline

Do this by refactoring the optimization and codegen pipelines into separate functions.

This saves a tiny bit of memory in non-LTO builds [1].

[1] https://llvm-compile-time-tracker.com/compare.php?from=fbddf22ef72d3c2e9b14e1501841b03380eef12b&to=cd276df52eb6f2b84a8e1efe5318460c6debf82d&stat=max-rss

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D111582
clang/lib/CodeGen/BackendUtil.cpp