Skip to content

Conversation

@tautschnig
Copy link
Collaborator

If .operands() is used in a non-const context, an unnecessary
(temporary) copy of the irep is created. Use as_const to avoid this.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented Nov 10, 2020

Codecov Report

Merging #5553 (a11293d) into develop (27f2a8a) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #5553   +/-   ##
========================================
  Coverage    68.53%   68.53%           
========================================
  Files         1187     1187           
  Lines        98263    98263           
========================================
  Hits         67347    67347           
  Misses       30916    30916           
Flag Coverage Δ
cproversmt2 43.09% <ø> (ø)
regression 65.71% <ø> (ø)
unit 32.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/util/expr.h 90.69% <ø> (ø)
src/util/simplify_utils.cpp 100.00% <ø> (ø)
src/util/std_expr.h 89.48% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27f2a8a...a11293d. Read the comment docs.

@kroening
Copy link
Collaborator

It's likely beneficial to remove the if((expr).has_operands()) line.

The reason why this was added was that .operands() might have added a named operands sub-node, which no longer exists.

@tautschnig tautschnig force-pushed the forall_operands-const branch from f12a86a to 04969ea Compare November 10, 2020 22:58
@tautschnig
Copy link
Collaborator Author

tautschnig commented Nov 10, 2020

It's likely beneficial to remove the if((expr).has_operands()) line.

Indeed, thank you!

If .operands() is used in a non-const context, an unnecessary
(temporary) copy of the irep is created. Use as_const to avoid this.
@tautschnig tautschnig force-pushed the forall_operands-const branch from 04969ea to a11293d Compare November 10, 2020 23:16
@tautschnig tautschnig changed the title forall_operands should not trigger and non-const operations forall_operands should not trigger any non-const operations Nov 10, 2020
@kroening kroening merged commit e7c110e into diffblue:develop Nov 11, 2020
@tautschnig tautschnig deleted the forall_operands-const branch November 11, 2020 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants