Skip to content

Commit

Permalink
Blockinstrument handle entry block throw
Browse files Browse the repository at this point in the history
Summary: The IR type checker and quality metrics pipelines broke due to BlockInstrument. If the block to be instrumented throws, do not make the new entry block with the instrument load params throw too.

Reviewed By: agampe

Differential Revision: D54691052

fbshipit-source-id: 63c6cdd716dfe728fb5d4e2a2b9897cfbf1e85c5
  • Loading branch information
itang00 authored and facebook-github-bot committed Mar 14, 2024
1 parent 2f155ff commit b1844ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions opt/instrument/BlockInstrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,13 @@ auto insert_prologue_insts(cfg::ControlFlowGraph& cfg,
auto it = cfg.find_insn(eb_insn);
b.block = it.block();
b.it = it.unwrap();
// the entry block with prologue opcodes should not retain throws from the
// block that it was split from
if (!cfg.entry_block()->cannot_throw()) {
cfg.delete_succ_edge_if(cfg.entry_block(), [](const cfg::Edge* e) {
return e->type() == cfg::EdgeType::EDGE_THROW;
});
}
}

if (slow_invariants_debug) {
Expand Down

0 comments on commit b1844ea

Please sign in to comment.