2647 Commits

Author SHA1 Message Date
Giacomo Vercesi ca3c5113d9 Add recompile-isolated 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 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 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 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 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 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
Lauri Vasama fbc1563b43 Add loop detection pass 2025-11-12 15:28:54 +02:00
Lauri Vasama d5d1734f5c Add expression usage helpers 2025-11-12 15:28:54 +02:00
Lauri Vasama cee099c2df Rename Clift GoToOp to GotoOp 2025-11-12 15:28:54 +02:00
Lauri Vasama 220439dfce Remove FunctionType::getCliftFunctionType
Change FunctionType::getFunctionType to return clift::FunctionType
instead of clift::ValueType.
2025-11-12 15:28:54 +02:00
Lauri Vasama 68436c58d6 StatementOpInterface::isIndirectlyNoFallthrough 2025-11-12 15:28:54 +02:00
Lauri Vasama 121f408bdd More Clift op helpers 2025-11-12 15:28:54 +02:00
Lauri Vasama c09862516d Make Clift operations commutative 2025-11-12 15:28:54 +02:00
Lauri Vasama a912df4c06 Fix loop label related issues 2025-11-12 15:28:54 +02:00
Alessandro Di Federico 5d3973b111 Model verify: allow / in most places
`/` is now supported in names except for the parts of the model that use
the name as the key, i.e., `DynamicFunction` and `LocalIdentifier`.

Eventually, `/` should be allowed there as well, but we first need to
make sure that when they end up in a location they are properly
escaped/unescaped.
2025-11-11 17:56:54 +01:00
Pietro Fezzardi 1480a3f0aa Move simplifyTerminator into IDS source file
The implementation of `simplifyTerminator` is very specific to the
operations of IDS, can be easily misused, and is not currently used
anywhere else in the codebase.
2025-11-06 13:32:56 +01:00
Pietro Fezzardi ff3ab1183d ScopeGraphUtils: improve simplifyTerminator docs 2025-11-06 13:32:56 +01:00
Alessandro Di Federico 21d9cb56a0 Ban functions in .bss 2025-11-05 12:02:58 +01:00
Alessandro Di Federico c883bed765 Drop Logger's StaticEnabled feature 2025-10-31 17:25:03 +01:00
Alessandro Di Federico d8b0395253 VariableManager: move fields declarations to top 2025-10-31 17:25:03 +01:00
Alessandro Di Federico 6b78293b22 RawBinaryView: outline to .cpp 2025-10-31 17:25:03 +01:00
Alessandro Di Federico 1429b526ab Introduce libtcg
This commit drops libptc in favor of its new form libtcg.

It brings several improvements, among which:

* The QEMU version we work on has been upgraded.
* CPUStateAccessAnalysis has been reimplemented in a way that makes it
  easier to debug and solves some limitations (e.g., tracking leaking
  pointers).
* Identification of pieces of the CPU state that are read by each helper
  and fixing access to the CPU state is now performed at build-time.
* We no longer mmap the code we need to translate, dropping all the
  issues related to code that needed to be mapped where something is
  already present.
* We now have two distinct flavors of helper modules: the full one and
  the "slim" one. The latter contains the definition only of functions
  we intend to inline. It is used in most of the pipeline, a good thing
  since we spend less time optimizing code we don't really care about.
  The full module is only used on the re-compilation branch of the
  pipeline.
* We no longer split the `cpu_loop` function.
* We change MetaAddress to rely on architectures from `model::` as
  opposed to the LLVM ones.
* We no longer attach debug info to LLVM IR containing the original
  assembly.
* We now verify that the lifted code only contains code we expect.
2025-10-31 17:25:03 +01:00
Lauri Vasama 086dc9fbc9 Remove RecursiveCoroutine operator*
* Add rc_eval to force evaluation.
2025-10-31 17:23:52 +01:00
Lauri Vasama 429608d122 RecursiveCoroutine improvements 2025-10-31 17:23:52 +01:00
Lauri Vasama fb34338310 Add UniqueCoroutineHandle 2025-10-31 17:23:52 +01:00
Ivan Krysak 5b419540cc Disable IRBuilder checks in some additional places 2025-10-31 09:04:59 +01:00
Alessandro Di Federico 0d5e05688d collectTuple: add non-recursive implementation 2025-10-29 15:10:18 +01:00
Alessandro Di Federico dfbe005307 ReadFields: switch to vectors 2025-10-29 15:10:18 +01:00
Alessandro Di Federico 46a0af46c8 TupleTree visits: improve handling of upcast 2025-10-29 15:10:18 +01:00