Commit Graph

3168 Commits

Author SHA1 Message Date
Antonio Frighetto 93cc2a5356 Drop Dump/CollectCFG.cpp
Unmaintained code has been removed.
2022-04-05 15:37:56 +02:00
Alessandro Di Federico f6c9b04c81 Adopt clang-tidy: readability-identifier-naming 2022-04-04 21:15:52 +02:00
Alessandro Di Federico 7dca2e78e0 Adopt new FunctionTags::Tag API 2022-03-31 16:41:30 +02:00
Pietro Fezzardi 58cdd814de MakeModelGEP: fix scoring for array accesses
This commit relaxes some assertions related to DLA, that were too strict
for general type systems not generated by DLA, and fixes the scoring of
the best access to select ModelGEPs.
2022-03-31 16:21:12 +02:00
Alessandro Di Federico 5576bfe86a EFA: add required libraries 2022-03-31 14:35:56 +02:00
Alessandro Di Federico 1a2a729e92 Rework FunctionTags::Tag 2022-03-31 12:51:24 +02:00
Alvise de Faveri 8230d91da7 Add RemoveExtractValues and RestoreExtractValues
* RemoveExtractValues transforms every `extractvalue` instruction
  into an opaque call. This prevents the optimization pipeline from
  moving around and optimizing `extractvalue`s, since they have a
  particular meaning in our IR
* RestoreExtractValues transforms such opaque calls back to regular
  `extractvalue`s at the end of the pipeline
2022-03-31 10:49:13 +02:00
Pietro Fezzardi ddf6c23be6 Migrate AddressOf to OpaqueFunctionsPool 2022-03-31 10:36:57 +02:00
Pietro Fezzardi 918bf8d2b1 Use new OpaqueFunctionsPool init methods 2022-03-30 17:21:48 +02:00
Pietro Fezzardi b0ce5466d6 MakeModelGEP: fix off-by-minus error in assertion 2022-03-28 17:58:42 +02:00
Ivan Krysak a10415fd0b Make the function layout argument type aware 2022-03-28 15:43:34 +02:00
Ivan Krysak 1b03adca5e Make function type convertions self-sufficient 2022-03-28 15:38:04 +02:00
Ivan Krysak f614a8cf7f Implement ABI SystemV_x86_64 stack support 2022-03-28 15:38:04 +02:00
Ivan Krysak ad7f47700a Rework how function type convertion handles names 2022-03-28 15:37:59 +02:00
Ivan Krysak 20bb0a2b90 Fix some minor abi::FunctionType issues 2022-03-28 15:37:59 +02:00
Ivan Krysak 326624f517 Fix TupleTreeCompatible linkage problem
Now all the generated `.cpp` include `Binary.h`. This ensures we don't
trigger the wrong concept due to forward declarations.

Also, this commit introduces a couple of `static_assert`s which should
enable us to early identification of similar problems.
2022-03-28 15:33:30 +02:00
Alessandro Di Federico 2ab50495aa LinkForTranslation: reorganize command printing 2022-03-28 12:17:05 +02:00
Massimo Fioravanti ce4934f48d Introduce revng-link-for-translation
`revng-link-for-translation` provides a standalone tool needed to
perform the final linking stage of the recompilation.
2022-03-28 12:17:05 +02:00
Massimo Fioravanti f63eefba2c Move LinkForTranslationPipe to lib/Recompile 2022-03-28 12:17:05 +02:00
Massimo Fioravanti c05b5dbb28 Steps now represent the *end* of a step
A special "begin" step has been introduced.
2022-03-28 12:17:05 +02:00
Massimo Fioravanti b362d926ec pipeline: drop implicit rank 0 2022-03-28 12:17:05 +02:00
Massimo Fioravanti 26ad273a84 PipelineC: s/copy_string/CopyString/ 2022-03-28 12:17:05 +02:00
Massimo Fioravanti c1d97bf8b3 pipeline: make globals serializable 2022-03-28 12:17:05 +02:00
Massimo Fioravanti de665fe03b PipelineC: new API to check if a target is ready 2022-03-28 12:17:05 +02:00
Massimo Fioravanti b1dac5d17b ContainerBase: introduce serialization primitives 2022-03-28 12:17:05 +02:00
Massimo Fioravanti 58768aca42 YAML pipelines: rename pipe "Name" to pass "Type" 2022-03-28 12:17:05 +02:00
Massimo Fioravanti 7eeb9f50c0 pipeline --verbose: print list of commands
`revng pipeline --verbose` will now print a list of equivalent commands
for the current invocation.
2022-03-28 12:17:05 +02:00
Massimo Fioravanti b2dfd2bc64 TupleTreeGenerator.cmake: single call generation 2022-03-28 12:17:05 +02:00
Massimo Fioravanti 6bd7f4bced Implement FileContainer::remove 2022-03-28 12:17:05 +02:00
Giacomo Vercesi 238450d9be pipeline: improve handling of 0-sized target lists 2022-03-28 12:17:05 +02:00
Massimo Fioravanti 73b8205377 pipeline::Loader: fix error message
Certain messages were missing a `\n`.
2022-03-28 12:17:05 +02:00
Massimo Fioravanti 900ac19228 ContainerSet::remove: removing 0 elements is fine
ContainerSet is now the one that has the burden to check that removal of
0 elements is always a success, rather than offloading that check onto
containers.
2022-03-28 12:17:05 +02:00
Massimo Fioravanti 5bdce4bf36 LoadModelPass: support command-line path
It is now possible to load a model from file instead of the one written
in the module itself:

    revng opt --model-path=<path>
2022-03-28 12:17:05 +02:00
Alessandro Di Federico af1828e090 DwarfImporter: better support for 0-sized types
We now ignore field of `struct`/`union` that have a 0-sized type.
We now also ignore types containing a an array with 0-sized elements.
2022-03-28 12:17:05 +02:00
Alessandro Di Federico 67706f05b6 Introduce a never-failing Type::trySize 2022-03-28 12:17:05 +02:00
Pietro Fezzardi d9906b572f MakeModelGEP: use perfect type match in scoring
Before this commit we did not take into account a perfect type match
when deciding the best ModelGEP to emit.

This commit changes the score to take it into account and score higher a
ModelGEP with perfect type match.
2022-03-28 09:51:52 +02:00
Pietro Fezzardi cd826fc52f MakeModelGEPPass: use CallToLifted tag 2022-03-28 09:51:50 +02:00
Pietro Fezzardi 0796e00d71 DLAMakeModelTypes: fix array fields 2022-03-28 09:51:01 +02:00
Filippo Cremonese 70a460c46a TupleTreeGenerator: use dataclasses
Give up on pydantic.
2022-03-22 17:52:02 +01:00
Alvise de Faveri 096ab1f5a1 Segregate: copy metadata on the new Call
Before this commit, SegregateStackAccessPass did not update properly the
metadata. Missing metadata did not allow the rest of the pipeline to
detect the special call.

This commit properly copies the metadata and updates the rest of the
pipeline to take care of the special call.
2022-03-22 11:48:27 +01:00
Alvise de Faveri ddf8adca70 DLA: drop ModelFuncHelpers and use shared ones 2022-03-22 10:55:16 +01:00
Alvise de Faveri 4d7e41e62a Add model type helpers to ModelHelpers 2022-03-22 10:55:11 +01:00
Alvise de Faveri 68a4665ea1 Handle markers in getExtractedValuesFromInst() 2022-03-22 10:50:45 +01:00
Pietro Fezzardi f69f68fe35 DLA: dump .dot for debug in dla::StepManager
Before this commit, each dla::Step handled the printing of its own .dot
files for debug.
This commit moves the logic for dumping the .dot files into the main
loop of dla::StepManager, guarding it with a single Logger.
2022-03-22 10:48:03 +01:00
Pietro Fezzardi 9f1bbc8b49 Drop deprecated \brief Doxygen directive
\brief is a stupid feature that we should stop using:
https://lists.llvm.org/pipermail/llvm-dev/2015-May/085152.html
2022-03-22 10:48:03 +01:00
Pietro Fezzardi ed5f4ac3e9 RemoveInvalidStrideEdges: handle 0-sized nodes
Before this commit, the dla::Step RemoveInvalidStrideEdges was not
taking into account that dropping edges could change the size of the
node where the edges originated from.

This commit fixes the problem, a) recomputing the size automatically
when needed, and b) adding proper dependencies in the dla middleend
pipeline, so that these changes are properly propagated updwards and
don't break any pre-conditions of following dla::Steps.
2022-03-21 17:15:27 +01:00
Pietro Fezzardi 3678e4f730 DLA: completely remove Inheritance edges 2022-03-21 17:08:46 +01:00
Pietro Fezzardi 7192cedcbb DLA: turn off Inheritance edges 2022-03-21 17:08:46 +01:00
Pietro Fezzardi bced6beacb MakeModelGEP: relax assertions on array size 2022-03-21 15:27:51 +01:00
Pietro Fezzardi 7971f0a20d Add dla::Step SimplifyInstanceAtOffset0
This step removes redundant instance-at-offset-0, collapsing the child
into the parent, whenever this operation does not induce instance-loops
on the graph.

This is intended to reduce the number of shallow wrapper structs and
unions.
2022-03-21 11:25:55 +01:00