Commit Graph

3419 Commits

Author SHA1 Message Date
Ivan Krysak df681aa573 Ensure consumed errors are printed somewhere 2025-10-13 10:26:41 +03:00
Ivan Krysak 25538385c8 Avoid using !! unless necessary
The only necessary place is when passing it into the  `BOOST_TEST`
macro, which doesn't convert its argument to `bool` internally.
2025-10-13 10:26:41 +03:00
Ivan Krysak e56f543b1a Split module.bc.zstd 2025-10-13 10:26:41 +03:00
Ivan Krysak fa24a51b05 Don't ignore TargetRegistry::lookupTarget output 2025-10-13 10:26:41 +03:00
Ivan Krysak 9bf93d3a30 Importers: add TODOs on diagnostic candidates 2025-10-13 10:26:41 +03:00
Ivan Krysak 16985c37ea Add comments clarifying error-related behavior 2025-10-13 10:26:41 +03:00
Ivan Krysak 5717d835f8 Add missing llvm::Error checks 2025-10-13 10:26:37 +03:00
Ivan Krysak c11761ceb5 Pipes: drop unused invalidateFromDiff 2025-10-08 12:22:34 +03:00
Ivan Krysak 68d62428d8 Lift: drop free loadBinary function 2025-10-08 12:22:34 +03:00
Ivan Krysak 0d9ea6db18 Inspector: drop a no-op llvm::consumeError 2025-10-08 12:22:34 +03:00
Ivan Krysak dadd836035 MetaAddress: assert validity 2025-10-08 12:22:34 +03:00
Ivan Krysak a88747cf99 Drop unused includes 2025-10-08 12:22:34 +03:00
Ivan Krysak 77ea07c364 Minor improvements 2025-10-08 12:22:30 +03:00
Giacomo Vercesi 6d1fbdca97 Implement infrastructure for PipeRuns
Add the needed infrastructures that allow ephemeral classes (`PipeRun`s)
to be wrapped as a regular pypeline `Pipe` class. These automatically
have their dependencies tracked and propagated to the pypeline.
2025-10-03 17:40:45 +02:00
Alessandro Di Federico 7783c0484a AVI: sort entry points by dominance
This commit a non-deterministic bug on ARM's switch-disjoint-ranges
test.

The problem was that we were setting as initial nodes of the monotone
framework all the nodes that are not reachable from the nodes classified
as initial nodes *so far*.
This approach is susceptible to the visit order.
Classifying certain nodes as entry nodes degrades the analysis results
since we associates a top value to them.

Electing initial nodes by traversing a list of nodes sorted by dominance
solves this problem.
2025-10-02 14:32:17 +02:00
Lauri Vasama 676fdfe0f5 Split common parts of Clift backend into new class
CEmitter contains utilities for emitting types, attributes and
declarations. These will be useful for generating headers from Clift.
2025-09-29 18:05:55 +03:00
Lauri Vasama 7fab96f119 Add dumpMlirModule for debugging 2025-09-29 18:05:55 +03:00
Lauri Vasama 18773ba22c Add Clift declaration attribute support 2025-09-29 18:05:55 +03:00
Lauri Vasama bf228a7c9b Reintroduce clift-opt emit-c transform 2025-09-29 18:05:55 +03:00
Lauri Vasama a50138998d Model agnostic Clift backend using CTokenEmitter 2025-09-29 18:05:55 +03:00
Lauri Vasama 653d451e6c Remove undef name configuration support
Also adds a model migration removing
Configuration.Naming.UndefinedValuePrefix.
2025-09-29 18:05:55 +03:00
Lauri Vasama 9eb6b5d6df Remove Clift backend stack frame inlining 2025-09-29 18:05:55 +03:00
Lauri Vasama 16a5ee0a56 Disable elaborated type specifier emission 2025-09-29 18:05:55 +03:00
Lauri Vasama 6914795e9e Fix Clift backend type emission 2025-09-29 18:05:55 +03:00
Lauri Vasama 77adbcc5ba Add import-model-names pipe 2025-09-29 18:05:55 +03:00
Lauri Vasama da638a9770 Rename ModuleValidator, extend visit interface 2025-09-29 18:05:55 +03:00
Lauri Vasama 6839ce4208 Add streaming CTokenEmitter interface 2025-09-29 18:05:55 +03:00
Lauri Vasama c3fd7d67a0 Add streaming ptml::Emitter interface 2025-09-29 18:05:55 +03:00
Lauri Vasama 549fc933f1 Add handle parameters to fields and enumerators 2025-09-29 18:05:55 +03:00
Lauri Vasama c8b12be980 Implement FunctionType parsing in C++ 2025-09-29 18:05:55 +03:00
Lauri Vasama 1b3d74d031 Remove harmful Clift type and attribute builders
"Smart" builders that create other attributes internally have turned out
to be more trouble than they're worth. It's simpler to just use the
default builders with the parameters that are actually needed for
initialising the type or attribute.
2025-09-29 18:05:55 +03:00
Lauri Vasama 4ea22c09a2 Set helper return type struct name in Clifter 2025-09-29 18:05:55 +03:00
Lauri Vasama bf0f9e00f0 Remove NameBuilder from Clift model type import 2025-09-29 18:05:55 +03:00
Lauri Vasama 37b8cc7771 Add MutableStringAttr 2025-09-29 18:05:54 +03:00
Lauri Vasama 375d40fc59 Move CTarget.h under revng/Support 2025-09-29 18:05:54 +03:00
Lauri Vasama 6b703e6ccd Fix C backend output on double negation 2025-09-29 18:05:54 +03:00
Lauri Vasama 5e120b3576 Fix local declaration emission order in Clifter
Fixes an issue where the AssignLabelOp targeting the function's entry
basic block would be emitted before its MakeLabelOp.
2025-09-29 18:05:54 +03:00
Andrea Gussoni 855a9309ec MaterializeLoopScopes: drop pass
Drop the `MaterializeLoopScopes` pass after the re-design the loop
matching stage to work entirely on `clift`, without the need to insert a
`scope_closer` edge to guide the emission.

Simultaneously, drop the DAGify `Head` metadata insertion, since it will
not be checked anymore during the `MaterializeLoopScopes` pass.
2025-09-26 10:39:09 +02:00
Andrea Gussoni 92e8ec3982 ScopeGraphUtils: improve isDAG check
We now ensure that even in case of blocks disconnected from the entry,
the `isDAG` function still search for loops in such parts of the graph.

This is achieved by instantiating multiple `scc_iterator` on the blocks
composing the underlying `Graph`.
2025-09-26 10:39:09 +02:00
Andrea Gussoni e34b6db644 SelectScope: assert no disconnected blocks 2025-09-24 15:51:06 +02:00
Andrea Gussoni b679c8c611 MTGoTo: assert no disconnected blocks 2025-09-24 15:51:06 +02:00
Andrea Gussoni b18cd59d31 ESE: assert no disconnected blocks 2025-09-24 15:51:06 +02:00
Andrea Gussoni a5c1fdb3fe IDS: assert no disconnected blocks 2025-09-24 15:51:06 +02:00
Andrea Gussoni 46fe7415ca DAGify: assert no disconnected blocks 2025-09-24 15:51:06 +02:00
Andrea Gussoni 2ba365bc45 DAGify: fix Head election
During the `Head` election phase, we now introduce the following
additional criterion:
When processing a `GenericRegion` nested into an outer one (its
`ParentRegion`), if the inner `Region` contains the block that has been
elected as `Head` of the `ParentRegion`, we also force that block to be
the `Head` of the inner `GenericRegion`.

We add a unit test to check this behavior.
2025-09-24 15:51:06 +02:00
Giacomo Vercesi 448f70e7dc Add trace runner
Add the tool `pypeline-trace-runner` which allows reading a serialized
pypeline schedule and execute it purely in C++.
2025-09-17 14:09:16 +02:00
Giacomo Vercesi 688b9fe111 Introduce compatibility with revng-pypeline
Add the necessary machinery to allow `Pipe`s, `Analysis`es,
`Container`s, `Model` and `ObjectID` to be implemented in C++ and used
by Python.
2025-09-17 14:02:40 +02:00
Giacomo Vercesi 5f5d2da842 check-conventions: check CMakeLists.txt license
The `check-conventions` script inadvertently ignored checking the
license header in `CMakeLists.txt`. Change the script so that those are
checked. Also add the missing headers to the reported files.
2025-09-17 14:02:40 +02:00
Ivan Krysak 2b194ace78 Adopt ModuleSlotTracker-aware dumpToString
Sadly, it can only be easily taken advantage of in non-IR-modifying
passes, but even just this is better than nothing.
2025-09-10 17:44:02 +02:00
Ivan Krysak 374ee341fa Remove an unused logger 2025-09-10 17:44:02 +02:00