mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
some minor ZAM optimization improvements
This commit is contained in:
parent
fadda05782
commit
e3b75ac391
4 changed files with 68 additions and 0 deletions
|
@ -228,6 +228,14 @@ bool ZAMCompiler::PruneUnused() {
|
|||
continue;
|
||||
}
|
||||
|
||||
if ( i == insts1.size() - 1 && inst->op == OP_RETURN_X ) {
|
||||
// A non-value return at the very end of the body
|
||||
// doesn't actually do anything.
|
||||
did_prune = true;
|
||||
KillInst(i);
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( inst->IsLoad() && ! VarIsUsed(inst->v1) ) {
|
||||
did_prune = true;
|
||||
KillInst(i);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue