Skip to content

Fix unnecessary irept copies found by check-irep-moves#8978

Open
tautschnig wants to merge 2 commits intodiffblue:developfrom
tautschnig:irept-copies
Open

Fix unnecessary irept copies found by check-irep-moves#8978
tautschnig wants to merge 2 commits intodiffblue:developfrom
tautschnig:irept-copies

Conversation

@tautschnig
Copy link
Copy Markdown
Collaborator

Address 8 findings from the clang-based irept copy checker:

  • 1 const reference (shadow_memory_util.cpp: unmodified copy)
  • 7 std::move (string_abstraction, goto_convert_side_effect, string_instrumentation, value_set, boolbv_extractbit, boolbv_index: source not used after copy)
  • Each commit message has a non-empty body, explaining why the change was made.
  • 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).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

tautschnig and others added 2 commits April 27, 2026 10:45
Address 8 findings from the clang-based irept copy checker:
- 1 const reference (shadow_memory_util.cpp: unmodified copy)
- 7 std::move (string_abstraction, goto_convert_side_effect,
  string_instrumentation, value_set, boolbv_extractbit,
  boolbv_index: source not used after copy)

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
Heuristic grep-based checker that flags local variables initialized
by copying an irept-derived type, where the variable is subsequently
modified and the source appears unused after the copy. These are
candidates for std::move to avoid unnecessary copy-on-write detach.

Found 22 candidates in goto-symex, 50 across the hot paths.
Each needs manual review — some are false positives (const ref
sources, loop-reused sources).

Usage: python3 scripts/check_irep_copies.py src/goto-symex/*.cpp

Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
@tautschnig tautschnig self-assigned this Apr 27, 2026
Copilot AI review requested due to automatic review settings April 27, 2026 10:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

❌ Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.50%. Comparing base (b32074b) to head (b8bc1cc).

Files with missing lines Patch % Lines
src/pointer-analysis/value_set.cpp 0.00% 1 Missing ⚠️
src/solvers/flattening/boolbv_extractbit.cpp 0.00% 1 Missing ⚠️
src/solvers/flattening/boolbv_index.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8978   +/-   ##
========================================
  Coverage    80.50%   80.50%           
========================================
  Files         1704     1704           
  Lines       188778   188778           
  Branches        73       73           
========================================
  Hits        151975   151975           
  Misses       36803    36803           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants