mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
Add ArithmeticToGEP pass
Introduce the ArithmeticToGEP canonicalisation pass. It detects pointers (LLVM-typed pointer values, model pointers flagged by the "revng.pointers" metadata, and pointer-tagged extract values) and rewrites integer arithmetic computed on top of them as i8 GEPs, followed by a ptrtoint when the original use needs an integer. For each obvious pointer the pass also walks backwards through Add chains and disambiguates the pointer operand of each Add when the other operand cannot be a pointer, so the rewrite extends to integer arithmetic that only later flows into a pointer use.
This commit is contained in:
@@ -353,6 +353,7 @@ branches:
|
||||
- peephole-opt-for-decompilation
|
||||
- ternary-reduction
|
||||
- exit-ssa
|
||||
- arithmetic-to-gep
|
||||
- pipe: switch-to-statements
|
||||
arguments: [llvm-functions]
|
||||
- pipe: pure-llvm-passes-pipe
|
||||
|
||||
Reference in New Issue
Block a user