Skip to content

Commit

Permalink
Disable lazy compilation when dumping
Browse files Browse the repository at this point in the history
Summary:
Only enable lazy compilation when we are actually compiling for
execution. For dumping, we should disable lazy compilation so the dump
is complete.

Reviewed By: avp

Differential Revision: D47744635

fbshipit-source-id: 5a91e19174fd2ed9482c309db8899cb715fcb21d
  • Loading branch information
neildhar authored and facebook-github-bot committed Jul 25, 2023
1 parent 29b0c7f commit 2842078
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/CompilerDriver/CompilerDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,8 @@ bool validateFlags() {
if (cl::LazyCompilation) {
if (cl::BytecodeFormat != cl::BytecodeFormatKind::HBC)
err("-lazy only works with -target=HBC");
if (cl::DumpTarget != Execute)
err("-lazy only works when executing");
if (cl::OptimizationLevel > cl::OptLevel::Og)
err("-lazy does not work with -O");
if (cl::BytecodeMode) {
Expand Down Expand Up @@ -1167,7 +1169,7 @@ std::shared_ptr<Context> createContext(
defaultFlags.preemptiveFunctionCompilationThreshold);
}

if (cl::EagerCompilation || cl::DumpTarget == EmitBundle ||
if (cl::EagerCompilation || cl::DumpTarget != Execute ||
cl::OptimizationLevel > cl::OptLevel::Og) {
// Make sure nothing is lazy
context->setLazyCompilation(false);
Expand Down

0 comments on commit 2842078

Please sign in to comment.