Commit Graph

145 Commits

Author SHA1 Message Date
Alessandro Di Federico 86f3dcf1ae Minor changes 2025-03-14 17:25:05 +01:00
Alessandro Di Federico c631f9505a JT::harvest: add a step doing instcombine 2025-02-20 17:58:26 +01:00
Alessandro Di Federico 62b518b381 Lift: limit instcombine to one iteration 2025-02-20 17:58:00 +01:00
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak 288448f009 Never include model::VerifyHelper from headers 2025-02-13 13:09:50 +02:00
Alessandro Di Federico 2128a80cc8 Preserve metadata after Function::deleteBody
Also, introduce and adopt a simple helper class to get this right.
2025-01-28 12:19:16 +01:00
Alessandro Di Federico b70b3cbe55 RootAnalyzer: improve logging 2025-01-28 12:19:16 +01:00
Alessandro Di Federico ab0010b3f6 Reduce usage of PostHelper jump targets 2024-12-03 12:13:15 +01:00
Ivan Krysak 1eb80ecd2d Introduce an error creation helper 2024-11-06 15:20:37 +02:00
Alessandro Di Federico 16e01f43d6 Import revng-c's FunctionTags.h 2024-10-31 17:19:51 +01:00
Alessandro Di Federico 79689f0da2 s/(LLVMContainer &)TargetsList/\1ModuleContainer/ 2024-09-27 12:07:18 +02:00
Alessandro Di Federico c1cbb4e9a0 Initialize pointers to nullptr 2024-09-27 12:07:17 +02:00
Alessandro Di Federico c8d4381297 s/Context &Ctx/Context &Context/g 2024-09-27 12:07:17 +02:00
Alessandro Di Federico 9bdce8e5c4 s/ExecutionContext &Ctx/ExecutionContext &EC/g 2024-09-27 12:07:17 +02:00
Alessandro Di Federico 12a0a89e15 Ensure every pipe commits what it should
This commit is the final step in ensuring all the pipes commit what they
should. It also asserts this actually happens, enabling us to easily
catch future problems.
2024-09-27 12:07:16 +02:00
Alessandro Di Federico 0126f0ce9b CodeGenerator: use VirtualSize when ptc.mmaping 2024-09-27 12:07:16 +02:00
Alessandro Di Federico 744184c90c Do not use CallBase::getCalledFunction
Use our wrapper, which does not return nullptr if the `FunctionType`s do
not match.
2024-08-07 16:07:59 +02:00
Alessandro Di Federico 901a78a66f Lift: fix usage of empty instead of isEmpty 2024-07-09 08:58:51 +02:00
Ivan Krysak dfa7478685 Adopt reworked model::Type 2024-06-27 11:05:51 +02:00
Ivan Krysak 94c9e9d4dd Make verifys inside asserts strict 2024-06-27 11:05:50 +02:00
Ivan Krysak 927e8006b9 Model: rename TypePath to DefinitionReference 2024-06-27 11:05:49 +02:00
Ivan Krysak 6a1018b860 Remove unused linter suppressors 2024-06-27 11:05:48 +02:00
Ivan Krysak ac587cbb4f Model: rename Type into TypeDefinition 2024-06-27 11:05:48 +02:00
Alessandro Di Federico f60c1bb4ad s/TrackGuard/DisableTracking/ 2024-06-20 10:24:51 +02:00
Alessandro Di Federico 553d869d03 Drop Pipe::print method 2024-06-20 10:24:51 +02:00
Alessandro Di Federico 148e6b1979 Rename all LLVMContainer arguments 2024-06-20 10:24:51 +02:00
Alessandro Di Federico bce1d6c0f3 Adopt invalidation along the core pipeline 2024-06-20 10:24:50 +02:00
Alessandro Di Federico b5f7576573 Rework TupleTreeGenerator tracking 2024-06-20 10:24:50 +02:00
Alessandro Di Federico d25d53e711 RootAnalyzer: use generic preserved registers
Before this commit, when outlining parts of `root` for analysis
purposes, we used to replace calls with a set of instructions clobbering
the set of register *not* preserved by such call, or, in case the
prototype was not available, by the default prototype.

This commit forces the usage of the default prototype.

This trades off precision with accuracy but we get the lift pipe not to
depend on any model::Function prototype.
2024-06-20 10:24:50 +02:00
Massimo Fioravanti 43349943a7 Stop serializing the model in the IR 2024-06-20 09:57:36 +02:00
Alessandro Di Federico 47c3dd8f0f Drop model::Segment::Sections 2024-05-22 10:25:25 +02:00
Alessandro Di Federico 3be8f4c3d3 Lift: require DefaultABI or DefaultPrototype 2024-05-22 10:25:25 +02:00
Alessandro Di Federico e64eee9402 CodeGenerator: handle partially valid instructions
Sometimes we have instructions that are, say, two bytes long but only
one of the two bytes are invalid (because they end up out of the
segment).
2024-05-15 13:19:42 +02:00
Alessandro Di Federico fe1dffcffd Add some missing includes
This is in preparation of reducing headers in Debug.h.
2024-05-03 21:52:40 +02:00
Pietro Fezzardi df3bd470a1 Enforce determinism on CSV handling
Various parts of revng replace `llvm::GlobalVariable`s representing CSVs
with Allocal/Load/Store. In particular, these are PromoteCSV,
RootAnalyzer and PromoteGlobalToLocalVars.

Before this commit, those places were sloppy when replacing CSVs with
Alloca/Load/Store, and did that iterating on a container sorted by
pointers. This caused Alloca/Load/Store to be emitted in different order
accross runs, which in turn caused more non-determinism down the
pipeline.

This commit fixes the non-deterministic behavior, sorting CSVs based on
their names, which should always be present and deterministic.
2024-03-19 09:43:59 +01:00
Ivan Krysak c9c4d5c8b6 Lift: stop using Layout 2024-03-18 19:32:34 +01:00
Alessandro Di Federico 250354bd27 ValueMaterializer: work around unreachable blocks 2024-03-15 19:05:10 +01:00
Alessandro Di Federico 83b94026e4 RootAnalyzer: handle missing prototype 2024-02-09 10:04:20 +01:00
Alessandro Di Federico a04ccb6883 CodeGenerator: relax check on entry point 2024-02-09 10:04:19 +01:00
Alessandro Di Federico f81851c36b CodeGenerator: do not tag LLVM intrinsics 2024-02-09 10:04:19 +01:00
Ivan Krysak 77b1acaf00 Prefer uint64_t to size_t wherever relevant 2024-01-29 11:57:54 +02:00
Andrea Gussoni 8125a19379 JumpTargetManager: improve rebuildDispatcher
Improve the way in which we connect the non reachable `JumpTargets` when
rebuilding the dispatcher for non `SemanticsPreserving` `CFGForm`s.

When connecting group of jump targets that are not currently reachable
from the entry dispatcher, we elect the jump target with the lowest
program counter value, as the one to be connected to the dispatcher.
We also mark the jump targets now transitively reachables from the
elected one, as reachable, so to avoid adding other unnecessary edges
from the dispatcher.
2024-01-18 11:06:17 +01:00
Massimo Fioravanti c276a439b5 Add pipeline invalidation
Replace the stub implementation of invalidation with the proper
implementation. A ReadPathCache is added to each global so that it can
keep tracks of what target are associated to which read paths.
2024-01-02 11:14:56 +01:00
Alessandro Di Federico 0e7d3a9a71 Pass PlainMetaAddress by pointer 2023-12-12 10:20:51 +01:00
Alessandro Di Federico d8e41028b7 RegisterClobberer -> OpaqueRegisterUser
Extend RegisterClobberer to support also performing opaque reads.
Also, record all the generated instructions for easy purging.
2023-12-11 16:29:13 +01:00
Giacomo Vercesi 0cb3e497a4 Fix typos 2023-11-02 16:48:33 +01:00
Alessandro Di Federico bd1b5e4ef9 newpc: add nomerge, willreturn, nounwind 2023-10-06 17:16:04 +02:00
Alessandro Di Federico f51af94e8f TupleTreeReference::isValid is for assertions only 2023-08-23 16:14:05 +02:00
Alessandro Di Federico 14525d91f5 Adopt llvm::Task 2023-08-01 10:51:16 +02:00
Alessandro Di Federico e0c7038f46 Rework RootAnalyzer::optimize pipeline
This commit reorganizes and explains the reasoning behind the design of
the RootAnalyzer optimization pipeline.
2023-07-26 10:16:25 +02:00