This patch adds a reserve call to an expensive function (llvm::LoadIntrinsics), and may fix a few other low hanging performance fruit (I've put them in comments for now, so we can discuss).
Motivation:
As I'm sure other developers do, when I build LLVM, I build the entire project with the same config (Debug, MinSizeRel, Release, or RelWithDebInfo). However, the Debug config also builds llvm-tblgen in Debug mode. Later build steps that run llvm-tblgen then can actually be the slowest steps in the entire build. Nobody likes slow builds.
This is more of a long term suggestion, as I'm not immediately sure how to modify this to eliminate the copy.