Optimize out arithmetic no-ops / moves

Open
#1,849 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp

Research direction

Start by tracing the ARM lifting example that produces r3_5 = arg1 - 0 and identify where this arithmetic operation interrupts type propagation. Done means arithmetic no-ops or moves no longer prevent the source argument type from propagating; the payload names no files or tests, so locating the relevant lifting and propagation entry points is part of the work.

Written by the indexing model from the issue text.

Description

Component: Core Effort: Low IL Optimization Impact: Low

I've seen e.g. subs used in ARM code several times as a move-and-compare:

sub.s r3, r0, #0

lifts to:

int32_t sub_f00(int32_t arg1)
char *r3_5 = arg1 - 0
puts(r3_5)

Because of the subtraction, type propagation stops at r3_5 rather than updating the argument type as well.

Dominant language
C++
Stars
1.3k
Forks
298
Avg merge
5d 5h
Merged PRs (30d)
19

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Vector35/binaryninja-api

All issues in Vector35/binaryninja-api

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.