Commit Graph

729 Commits

Author SHA1 Message Date
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak 5b8c03b89a Introduce unit tests for comment placement 2025-02-13 13:09:50 +02:00
Ivan Krysak 8841bc7144 Don't include model::NameBuilder from the binary 2025-02-13 13:09:50 +02:00
Ivan Krysak a93ffd3760 Rename UnusedStackArgumentBytes
Old name was `StackBytesAllocatedForRegisterArguments`.
2025-02-12 16:43:19 +02:00
Lauri Vasama 6343bfcb40 Add c-verify pass 2025-01-30 14:52:47 +02:00
Lauri Vasama b7047d3854 Remove Clift backend PTML tags unit test 2025-01-29 23:58:24 +01:00
Pietro Fezzardi 8114c19164 Replace WIP comment with TODO 2025-01-29 15:17:15 +01:00
Andrea Gussoni 684cbf649a ScopeGraph: implement Inverse<Scope<>>
Implement the `Inverse<Scope<...>>` `GraphTraits`. This are needed in
order to support the computation of the `PostDominatorTree` on a
`ScopeGraph`.

Add some `FileCheck` tests to test the dominator and postdominator trees
on the `ScopeGraph`.
2025-01-15 11:48:28 +01:00
Lauri Vasama 96312ce164 Add Clift C Backend LIT tests 2025-01-10 08:04:20 +02:00
Lauri Vasama db6b757c42 Remove duplicate C++ unit test 2025-01-10 08:03:20 +02:00
Lauri Vasama 8515ffffce Move Clift label C++ unit test to LIT 2025-01-10 08:03:20 +02:00
Lauri Vasama aaddafa15b Add check for conflicting local names in Clift 2025-01-10 08:03:20 +02:00
Lauri Vasama 4cedc22efb Merge access ops into AccessOp with indirect flag 2025-01-02 11:25:32 +02:00
Lauri Vasama fe2e70e885 Improve label and goto ops 2025-01-02 11:25:32 +02:00
Andrea Gussoni 26cf42eb12 ESE: Introduce the Enforce Single Exit pass
Introduce the Enforce Single Exit pass, whose task is to normalize a
generic `ScopeGraph`, which may have multiple exit blocks (and/or
infinite loop regions), in order to have a single `sink_block` as exit
block.

This is done by adding a new entry block, a `sink_block`, and some
`scope_closer` edges (which are visible only on the `ScopeGraph`) that
enforce the property.

This is done taking inspiration from how the internally the
`PostDominatorTree` pass construct the temporary graph on which the post
dominance information is computed on.

Some unit tests are added in order to verify that the pass works as
expected.
2024-12-18 10:51:40 +01:00
Andrea Gussoni fa69bd24e5 ScopeGraph: introduce the ScopeGraph
Introduce the `ScopeCloser` and `GotoTarget` annotations in the IR, and
the relative necessary machinery, needed to handle scope closer and goto
edges for the new backend.

A specialization of the `llvm::GraphTraits`, called `ScopeGraph`, that
is able to handle both the above mentioned annotations is provided.

For the `llvm::GraphTraits` implementation, we introduce the
`GeneratorIterator` class, which uses a coroutine to store the status of
the iteration.

A debug logger pass is added, so that we are able to test the
functionality with `FileCheck`.
2024-12-05 15:43:57 +01:00
Alessandro Di Federico 143c315196 Merge revng-c into revng 2024-11-21 10:50:55 +01:00
Ivan Krysak 64446d0453 Adopt name builder across the model users 2024-11-06 19:18:53 +02:00
Ivan Krysak 672ee5df50 Replace std::string_view with llvm::StringRef 2024-11-06 15:43:13 +02:00
Ivan Krysak a67ba96644 Adopt name builder across the model users 2024-11-06 15:43:13 +02:00
Ivan Krysak c101770c72 ModelTypeTests: pass the binary to the verifier 2024-11-06 15:42:44 +02:00
Alessandro Di Federico 4e670ac8e6 Either link revngcSupport or revngSupport 2024-11-04 15:09:56 +01:00
Lauri Vasama 2d2fe890fb Add Clift expression operations 2024-10-31 08:41:25 +01:00
Lauri Vasama e1b55fd5c3 Add custom assembly format for Clift FunctionOp 2024-10-31 08:41:25 +01:00
Lauri Vasama 2350f91c48 Use symbol attribute for GlobalVariableOp 2024-10-31 08:41:25 +01:00
Lauri Vasama c29a71a0d9 Add colon in clift.undef assembly format 2024-10-31 08:41:25 +01:00
Giacomo Vercesi 3fc9bbf8fc Uniform GzipStream
Uniform the functions/classes in GzipStream with the ones in ZstdStream.
2024-10-30 21:57:55 +01:00
Ivan Krysak 1a35cbcb77 Introduce PTMLCTypeBuilder 2024-10-15 10:45:13 +03:00
Ivan Krysak 8288bd68d2 PTMLCBuilder: rename into ptml::CBuilder 2024-10-15 09:13:28 +02:00
Alessandro Di Federico a0c670652c Improve usages of Expected<T> 2024-10-10 14:50:26 +02:00
Ivan Krysak 724f8bfb59 ABI: streamline terminology
"packed" is used instead of "unnaturally aligned".
2024-10-08 13:53:53 +02:00
Ivan Krysak 3f803ccc5c ABI-tests: add potential padding support 2024-10-08 13:53:53 +02:00
Ivan Krysak 6063015975 ABI-tests: support return-value-less SPTAR 2024-10-08 13:53:53 +02:00
Ivan Krysak 561f94115a ABI: make pointer to copy testing stricter 2024-10-08 13:53:52 +02:00
Giacomo Vercesi 212cfdc613 mlir_lit_tests: generate proper tar file
Using an empty file as a tar file is not 100% compliant. Use an actual
`tar` invocation to generate the file.
2024-10-01 20:34:38 +02:00
Giacomo Vercesi 993f66d59c revng cli: drop revng- prefix from libexec
Drop using the `revng-` prefix from all executables under
`libexec/revng/`. Now any executable found under there that is
executable and without extension will be considered a `revng`
subcommand, following the usual command-line rules.
2024-10-01 13:38:14 +02:00
Alessandro Di Federico 33cae7de12 Pipeline: reduce usage of Context 2024-09-27 12:07:18 +02:00
Alessandro Di Federico fbf79b5d1b Make Pipe::checkPrecondition optional 2024-09-27 12:07:18 +02:00
Alessandro Di Federico bc064244d6 s/deserialize/fromString/g 2024-09-27 12:07:17 +02:00
Alessandro Di Federico c1cbb4e9a0 Initialize pointers to nullptr 2024-09-27 12:07:17 +02:00
Alessandro Di Federico 2cdedc71f4 s/serialize/toString/
We keep serialize for method dealing with streams.
If it returns a `std::string`, let's use `toString`.
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 850276f5c8 Minor changes 2024-09-27 12:07:16 +02:00
Alessandro Di Federico ca99bbbb66 Adopt toString() 2024-09-26 17:51:08 +02:00
Andrea Gussoni 5849deee50 Remove CycleEquivalenceInfo 2024-09-20 21:06:46 +02:00
Andrea Gussoni 70734496f3 GenericGraph: remove Undirected
Remove the `Undirected` `GraphTraits`
2024-09-20 16:08:50 +02:00
Andrea Gussoni 76cb852c28 Implement GenericRegionInfo
We implement the `GenericRegionInfo` analysis.

The analysis accepts a template parameter which enables to run it on
every graph which exposes `llvm::GraphTraits`.
The `GenericRegionPass` is responsible for instantiating and running the
analysis on a `llvm::Function`.

The `GenericRegionInfo` analysis uses, and takes insipiration from the
`GenericCycleInfo` LLVM analysis.

The analysis exposes a tree of well nested `GenericRegion`s, which are
constructed starting from the well nested tree of `GenericCycle`s.
In addition, we perform the election of the `Head` of each
`GenericRegion`, and the election of the retreating edges.
2024-09-19 18:11:19 +02:00
Lauri Vasama 35759476b6 Add Clift LIT/FileCheck tests
Some C++ unit tests were also converted into more easily maintainable
LIT/FileCheck tests.
2024-09-04 10:58:02 +02:00