Commit Graph

6113 Commits

Author SHA1 Message Date
Qian Matteo Chen 8667f64081 [TypeShrinking] Remove initial defuse poc pass 2020-12-23 01:13:07 +01:00
Qian Matteo Chen fa05ef07f9 [TypeShrinking] Make solving mfp static 2020-12-23 01:09:37 +01:00
Qian Matteo Chen 31b8ed7b14 [TypeShrinking] Move BitLiveness.h to local folder 2020-12-23 01:03:56 +01:00
Qian Matteo Chen ba099220da [TypeShrinking] Add type shrinking mvp 2020-12-23 00:14:03 +01:00
Qian Matteo Chen 86cd1d5505 [TypeShrinking] Add and fix copyright notices 2020-12-22 20:08:06 +01:00
Qian Matteo Chen cccd462b64 [TypeShrinking] Add example of MonotoneFramework 2020-12-22 18:33:24 +01:00
Qian Matteo Chen 60c4e59c6b [TypeShrinking] Refactor MFP to use GraphTraits 2020-12-22 18:30:33 +01:00
Qian Matteo Chen 6054d08645 [TypeShrinking] Use llvm::cast 2020-12-22 18:22:45 +01:00
Qian Matteo Chen 3d8793fa2a [TypeShrinking] Move implementation to cpp file 2020-12-22 18:19:43 +01:00
Qian Matteo Chen 8a7813fabf [TypeShrinking] Add BitSet using directive 2020-12-22 18:00:49 +01:00
Qian Matteo Chen be3d67026f [TypeShrinking] Assert success of cast 2020-12-22 17:21:08 +01:00
Qian Matteo Chen f6978a9879 [TypeShrinking] Move using and pass registration 2020-12-22 17:18:20 +01:00
Qian Matteo Chen 75b77af481 [TypeShrinking] Refactor iterator uses 2020-12-22 17:15:11 +01:00
Qian Matteo Chen 25f4a112c4 [TypeShrinking] Explicit auto * for GraphNode 2020-12-22 17:12:05 +01:00
Qian Matteo Chen 0bd393a691 [TypeShrinking] Use explicit pointer types 2020-12-22 17:07:51 +01:00
Qian Matteo Chen 473982966b [TypeShrinking] Combine isLess and areEqual 2020-12-22 17:04:55 +01:00
Qian Matteo Chen df93bd474b [TypeShrinking] Add newline at the end of the file 2020-12-22 17:01:26 +01:00
Qian Matteo Chen 335eb24191 [TypeShrinking] Remove c-style comments 2020-12-22 16:58:25 +01:00
Qian Matteo Chen 7feebad315 [TypeShrinking] Add implementation of MFP
See Principles of Program Analysis, Springer 2005, p 75
2020-12-22 16:55:16 +01:00
Qian Matteo Chen c1d144f186 [TypeShrinking] Add pass to print dataflow edges 2020-12-22 16:39:38 +01:00
Pietro Fezzardi ebe43602ac New FilterForDecompilation passes
This commits adds two passes
- FilterForDecompilationFunctionPass deletes the body of a Function if
  it's not a isolated function produced by revng
- FilterForDecompilationModulePass deletes all the bodies of the
  functions that are not isolated functions generated by revng

These passes are used at the beginning of the decompilation pipeline, to
prevent all the passes of the decompilation pipeline to run on root and
other big functions coming from QEMU that do not need to be decompiled.
2020-12-16 18:20:58 +01:00
Pietro Fezzardi 2162aa683d Add basic tests for public API decompileFunction 2020-12-01 18:12:00 +01:00
Pietro Fezzardi 14925de090 libDecompiler: link missing libclangSerialization 2020-12-01 18:03:55 +01:00
Pietro Fezzardi 08c76374a2 MakeEnvNullPass is now a FunctionPass
This fixes an issue causing crashes when calling the public API
`decompileFunction`, that was internally adding a `MakeEnvNullPass`
(formerly a `ModulePass`) to a `FunctionPassManager.
2020-12-01 17:34:30 +01:00
Pietro Fezzardi 9111d35577 CMakeLists.txt drop last ref to old RemovePCStores 2020-11-25 11:29:55 +01:00
Alessandro Di Federico b420128e9f Merge 'feature/lifting-performance-improvements' 2020-11-23 14:53:36 +01:00
Alessandro Di Federico c6d0ce9dec Don't use RPOT for DisjointRanges
Sorting the BasicBlocks on which DisjointRanges works is detrimental for
performance.  Using a random order takes less time. This is due to the
fact that the number of BasicBlocks to analyze is significantly smaller
than the whole list of BasicBlocks.
2020-11-23 14:52:46 +01:00
Alessandro Di Federico cbe4967aad SymbolTableList::size() is expensive
This simple commit reduces the number of times we query the size of the
`BasicBlock` list of a `Function` during the final reodering of blocks
before emission.

This change introduces a 25% speedup when lifting `/bin/bash`.
2020-11-23 10:20:43 +01:00
Alessandro Di Federico c313fdbcb0 CSAA: verify module only if --debug-log=verify
This commit brings a 6% speedup in lifting `/bin/bash`.
2020-11-23 10:20:43 +01:00
Alessandro Di Federico 0ccc32af08 Performance: destroy AVI PassManager ASAP
It is important to let the pass manager go out of scope ASAP:
LazyValueInfo registers a lot of callbacks to get notified when a Value
is destroyed, slowing down OptimizedFunction->eraseFromParent
enormously.

This commit introduces a speedup of approximately 25% when lifting
`/bin/bash`.
2020-11-22 15:14:44 +01:00
Alessandro Di Federico dab8a2dfae Install clang-format-style-file 2020-11-20 18:06:16 +01:00
Alessandro Di Federico 7cb569bf1b Merge branch 'feature/new-include-conventions' 2020-11-20 15:26:57 +01:00
Pietro Fezzardi b434e10f92 ASTBuildAnalysis: enable returning const aggregate 2020-11-19 17:11:03 +01:00
Pietro Fezzardi 584faf5097 Add MakeEnvNullPass to decompilation pipeline 2020-11-18 18:04:14 +01:00
Pietro Fezzardi b331fb9275 Drop tests for standalone passes
All these passes are already tested in the pipeline end-to-end tests,
testing them all alone only makes the tests run longer.
2020-11-18 18:04:14 +01:00
Pietro Fezzardi d4d8430553 Add MakeEnvNull pass
This pass substitutes the `@env` global variable with a null pointer
`@env` is a pointer to the CPU state in QEMU, and is not meant to be
visible in the decompiled code.
This pass is used to remove all references to it before decompilation.
2020-11-17 14:33:19 +01:00
Pietro Fezzardi e79dcaf780 check-revng-conventions: enforce #pragma once 2020-11-13 14:12:18 +01:00
Pietro Fezzardi 9869f057b9 Use #pragma once for header include guards 2020-11-13 14:12:18 +01:00
Pietro Fezzardi 1a09c00aa1 check-revng-conventions: regroup header includes 2020-11-13 10:00:27 +01:00
Pietro Fezzardi cd9bc34d9d Enforce new include conventions 2020-11-13 10:00:24 +01:00
Pietro Fezzardi dc4ab84ad3 Move .clang-format to scripts/
The format file has also been renamed to revng-clang-format-style-file.

The check-revng-conventions scripts now always uses the same format
file, unless otherwise specified with the new option
--use-local-clang-format-file.

In this way, the check-revng-conventions uses the same format in all the
projects by default, but if a project needs to customize it (e.g.
cold-revng which follows the Qt style) it can use the new flag to
fallback to using the local .clang-format file.
2020-11-13 09:59:42 +01:00
Alessandro Di Federico ab6c8276f5 AVI: handle pointer as smallest operation 2020-11-12 20:36:02 +01:00
Alessandro Di Federico bcd1554546 Do not add to CodePointers invalid addresses 2020-11-12 20:36:02 +01:00
Alessandro Di Federico 2fee00f01e Ignore undefined symbols 2020-11-12 20:35:58 +01:00
Pietro Fezzardi 429633b627 Use #pragma once for header include guards 2020-11-12 18:00:45 +01:00
Pietro Fezzardi 93d9cbb67b Enforce new include conventions 2020-11-12 18:00:45 +01:00
Pietro Fezzardi 47cdb9fcc9 Remove .clang-format style file 2020-11-12 17:44:10 +01:00
Alessandro Di Federico ae500fa314 Assert ELFs are executables or .so 2020-11-12 16:39:28 +01:00
Alessandro Di Federico 14cf2a399d Make assertion messages prettier 2020-11-12 16:39:03 +01:00
Alessandro Di Federico 56b6797f8c scripts/revng: backport shlex.join 2020-11-12 16:21:32 +01:00