[BOLT] Skip instruction shortening (#93032)

Add the ability to disable the instruction shortening pass through
--shorten-instructions=false
This commit is contained in:
Daniel Hill
2024-07-19 16:52:01 -07:00
committed by GitHub
parent fada922732
commit b686600a57

View File

@@ -263,6 +263,10 @@ static cl::opt<bool> CMOVConversionFlag("cmov-conversion",
cl::ReallyHidden,
cl::cat(BoltOptCategory));
static cl::opt<bool> ShortenInstructions("shorten-instructions",
cl::desc("shorten instructions"),
cl::init(true),
cl::cat(BoltOptCategory));
} // namespace opts
namespace llvm {
@@ -378,7 +382,8 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
else if (opts::Hugify)
Manager.registerPass(std::make_unique<HugePage>(NeverPrint));
Manager.registerPass(std::make_unique<ShortenInstructions>(NeverPrint));
Manager.registerPass(std::make_unique<ShortenInstructions>(NeverPrint),
opts::ShortenInstructions);
Manager.registerPass(std::make_unique<RemoveNops>(NeverPrint),
!opts::KeepNops);