Skip to content

ssa_exprt::get_object_name: add fast path #4193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ssa_exprt::get_object_name: add fast path
In many cases (without field sensitivity actually: always) the object will just
be the original expression, no further processing is required. Thus add a fast
path that handles this case directly, which reduces the cost from 967 seconds
across all of SV-COMP's ReachSafety-ECA down to 143 seconds.
  • Loading branch information
tautschnig committed Feb 14, 2019
commit 148fd4591ffe0a06efaee25c0ff13b69a4a0236e
7 changes: 6 additions & 1 deletion src/util/ssa_expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ class ssa_exprt:public symbol_exprt

irep_idt get_object_name() const
{
const exprt &original_expr = get_original_expr();

if(original_expr.id() == ID_symbol)
return to_symbol_expr(original_expr).get_identifier();

object_descriptor_exprt ode;
ode.object()=get_original_expr();
ode.object() = original_expr;
return to_symbol_expr(ode.root_object()).get_identifier();
}

Expand Down