Skip to content

Commit b686600

Browse files
authored
[BOLT] Skip instruction shortening (#93032)
Add the ability to disable the instruction shortening pass through --shorten-instructions=false
1 parent fada922 commit b686600

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bolt/lib/Rewrite/BinaryPassManager.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ static cl::opt<bool> CMOVConversionFlag("cmov-conversion",
263263
cl::ReallyHidden,
264264
cl::cat(BoltOptCategory));
265265

266+
static cl::opt<bool> ShortenInstructions("shorten-instructions",
267+
cl::desc("shorten instructions"),
268+
cl::init(true),
269+
cl::cat(BoltOptCategory));
266270
} // namespace opts
267271

268272
namespace llvm {
@@ -378,7 +382,8 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
378382
else if (opts::Hugify)
379383
Manager.registerPass(std::make_unique<HugePage>(NeverPrint));
380384

381-
Manager.registerPass(std::make_unique<ShortenInstructions>(NeverPrint));
385+
Manager.registerPass(std::make_unique<ShortenInstructions>(NeverPrint),
386+
opts::ShortenInstructions);
382387

383388
Manager.registerPass(std::make_unique<RemoveNops>(NeverPrint),
384389
!opts::KeepNops);

0 commit comments

Comments
 (0)