[AutoUpgrade] Add flag to disable autoupgrading debug info
authorArthur Eubanks <aeubanks@google.com>
Thu, 2 Feb 2023 23:29:20 +0000 (15:29 -0800)
committerArthur Eubanks <aeubanks@google.com>
Tue, 14 Mar 2023 19:41:46 +0000 (12:41 -0700)
commita4d3bc68142e67c1cbceef3ac33cdaf9b78fd84a
tree2884ffc7f7a8c4223b2c78d230e88c97c5b0399b
parentcb743dd8371597f75fac62b8b854e068d215373a
[AutoUpgrade] Add flag to disable autoupgrading debug info

Auto-upgrade can be expensive, especially UpgradeDebugInfo() since it runs the verifier.

With this patch, we can specify that the imported bitcode is built with the same revision of LLVM, meaning there's no need to run any auto-upgrading. For now, limit this to just debug info since projects like Rust want to support multiple versions of LLVM at the same time (at compiler build time, not at Rust source code build time) and run a subset of the autoupgrade functionality for simplicity.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D143229
llvm/lib/IR/AutoUpgrade.cpp
llvm/test/LTO/X86/strip-debug-info.ll