6758 Commits

Author SHA1 Message Date
Alessandro Di Federico 5f5877c9a7 Merge branch 'feature/pypeline-implement-first-half' 2025-11-19 09:35:28 +01:00
Giacomo Vercesi e32c92b164 Add pypeline comparison tests
Add a set of tests to the test suite that compare the output of the new
pipeline (via `revng2`) to the output of the old one.
2025-11-18 17:47:54 +01:00
Giacomo Vercesi ca3c5113d9 Add recompile-isolated to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 8f5e7feb4f Add recompile savepoint to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 159ca6b965 Add LinkForTranslation to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi af4b447f89 Add CompileRootModule to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 7462c2daeb Add LinkSupport to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi d5aeb306f6 Add YieldAssembly to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi a834f874c9 Add ProcessAssembly to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 080c5017f1 Add HexDump to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi b77833d2bf Add enforce-abi savepoint to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 77f925c792 Add PromoteCSVs to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi a685cd1055 Add EnforceABI to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 9f46ddac6b Add isolate savepoint to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 0758a95110 Add AttachDebugInfo to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 0df05f97b7 Add Isolate to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 819538a5df Add CollectCFG to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi cf52901d6d Add GenerateModelTypeDefinition to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi ddb36fc70f Add ModelToHeader to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi fe9dda7a13 Add lifted savepoint to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 95365c1fb9 Add PureLLVMPasses{Root,}Pipe to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 97b471c888 Add Lift to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 25d3541864 Add ImportFiles to pypeline 2025-11-18 17:47:54 +01:00
Giacomo Vercesi 3a5b5de96b ImportFiles: fix returned dependencies
Also return a dependency on the `/Binaries` vector, so that if an
element is added it also invalidates.
2025-11-18 17:47:54 +01:00
Giacomo Vercesi 1b9fb62a33 SingleOutputPipe: relax assertion
Relax the assertion at the beginning of `SingleOutputPipe` that
triggered an assertion when 0 objects where requested for output.
2025-11-18 17:47:54 +01:00
Giacomo Vercesi 5297a354ad PipeRunPipes: automatically track progress
Automatically create a `Task` object when a pipe with multiple steps
(e.g. `FunctionPipe`) is run.
2025-11-18 17:47:54 +01:00
Giacomo Vercesi b4f9147646 Introduce LLVMFunctionsContainer
Add another container for LLVM modules. This one stores one
`llvm::Module` per function (all modules share the same
`llvm::LLVMContext` for performance reasons).
2025-11-18 17:47:54 +01:00
Giacomo Vercesi a39906ca85 Factor out cloneFiltered from LLVMContainer
Move the body of `cloneFiltered` from `LLVMContainer` into a free
function in `IRHelpers.h`.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 57d9c3deb8 PipeboxCommon: add Access enum
Add an enum to explicitly specify the `TaskArgumentAccess` of a given
`Pipe`. This is needed because in some cases it's required to manually
specify the `READ` or `WRITE` access.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 1c07656448 pipebox.py: add initialize function
Add the `initialize` function to `pipebox.py`. This allows passing
command-line arguments to the pipebox.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 153fcf2773 InitRevng: initialize LLVM components
In the constructor of `InitRevng` also call all the `llvm::initialize*`
functions. This is done to be less implementation-specific and having
these functions be called in
`LLVMPipelineRegistry.libraryInitialization`.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 65ce5c1224 InitRevng: check for double initialization
In the constructor of `InitRevng` check that the class has only been
initialized once.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 4f93c9e7ad Container: add mime type
Add the `MimeType` field to the C++ classes. Forward it to python via
nanobind.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 5b24fff3cc Model: add missing methods
Add the missing `model_name` and `mime_type` to the `Model` class.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi a8aa034acf Registrars.h: fix out-of-bounds read
The `name` parameter of the `nanobind::class_` constructor needs to be
NULL-terminated. Copy the `StringRef` to a temporary string to add the
missing `\0`.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 000d75dbb7 pypeline: add check_precondition to Pipe
Add the `check_precondition` function to the `Pipe` class. This will be
run before the actual schedule creates containers and runs itself
proper.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 38921a182c Pipe: drop incorrect assertion
In `prerequisites_for`, if a pipe has a container in `READ` then it
needs to be forwarded backward, not asserted on.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 5a530e66dc Savepoint: optimize run function
Optimize the `run` function to skip objects that have just been
serialized when deserializing objects for outgoing requests. For
example, previously if a schedule had for a savepoint:

```yaml
incoming: ["/binary"]
outgoing: ["/binary"]
```

then the `Savepoint.run` function would have first serialized the object
into storage and then deserialized it right after, instead with the new
function the object is only serialized.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 94e9712927 Requests: add overloaded get
Overload the `get` function of `Requests` so that, in addition to the
usual `Mapping` behavior, will return an empty `ObjectSet` if no default
is specified.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi a3a3967625 Pipeline: fix graph function
Fix a few bugs present in the `Pipeline.graph` function which lead to
the graph being completely unconnected.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 437d86d8cb Pipeline: improve schedule
Improve the `schedule` in the `Pipeline` class by introducing two
optimizations:
* Prune all the `ContainerDeclarations` that are not actually used.
* Skip all tasks that have no outgoing elements that would have been
  written by them.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 2875565b9f Pipeline: show minimized request on assertion
When asserting that a request should be empty, show a minimized version
with all the empty members removed, for ease of reading.
2025-11-17 10:04:13 +01:00
Giacomo Vercesi 964abca598 pypeline: allow multiple root nodes
Change the `Pipeline` class and `pypeline_parser.py` to allow multiple
root nodes to be specified when creating a `Pipeline` object.
2025-11-17 10:04:12 +01:00
Giacomo Vercesi d42cd5aeab pypeline: allow arbitrary config objects
Allow the `configuration` field of a pipe in a pipeline yaml file to be
of any type. When constructing the pipe object, the object will be
re-serialized via `yaml.dump` before being passed to the constructor.
2025-11-17 10:04:12 +01:00
Giacomo Vercesi c0e35d080e ContainerDeclaration: enable order
`ContainerDeclaration` needs to be orderable (e.g. have `__lt__`) to
allow `deterministic_sort_key` to work.
2025-11-17 10:04:12 +01:00
Giacomo Vercesi 824ec6194a PipelineNode: improve __repr__ function 2025-11-17 10:04:12 +01:00
Giacomo Vercesi d90f6ff0f5 revng2: use cache_directory from support 2025-11-17 10:04:12 +01:00
Giacomo Vercesi e38b55db64 pype project artifact: fix typo in code 2025-11-17 10:04:12 +01:00
Giacomo Vercesi ba4004691d pype project artifact: fix asking all objects
The `objects` argument was missing `required=False` which meant that all
invocations needed to specify the objects to request.
2025-11-17 10:04:12 +01:00
Giacomo Vercesi 32fd86d33a Pipe: drop name argument in constructor
Having a pipe's name different from its class name is useless, drop the
feature entirely.
2025-11-17 10:04:12 +01:00