Commit Graph

6487 Commits

Author SHA1 Message Date
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 d8ea0fc805 Add missing TypeDefinitionAttr on attributes
* Removed from field attribute where it does not belong.
2025-09-29 18:05:55 +03:00
Lauri Vasama 1ce6f256a7 Improve Clift local and global syntax 2025-09-29 18:05:54 +03:00
Lauri Vasama 37b8cc7771 Add MutableStringAttr 2025-09-29 18:05:54 +03:00
Lauri Vasama 94ba300f2d Add inherent handle attributes on local and label 2025-09-29 18:05:54 +03:00
Lauri Vasama b1b6a0e93c Add Location conversion utilities 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 eb45307fb4 Fix pipeline::Location::back 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
Pietro Fezzardi 9c66f018e3 Merge branch 'feature/fix-dagify-head-election' 2025-09-26 12:01:03 +02: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 08781ab2a6 GraphAlgorithms: hasUnreachableBlocks helper
Introduce the `hasUnreachableBlocks`, which can be used to test that
blocks disconnected from the entry of the `GraphT` do not exists.
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
Andrea Gussoni 817c5c0e23 GraphAlgorithms: propagate template arguments 2025-09-24 15:51:02 +02:00
Alessandro Di Federico e168fb70d6 Merge branch 'feature/nanobind' 2025-09-17 16:53:26 +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 c68b7f1ab6 TupleTreeGenerator: make all keys hashable
Make all `Key` structs generated by TupleTreeGenerator have a
`std::hash` specicialization.
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 8cc4082223 model-from-scratch: fix a broken link 2025-09-12 18:57:48 +03:00
Ivan Krysak 3c8ca061ef model-from-scratch: improve wording 2025-09-12 18:57:31 +03:00
Pietro Fezzardi 37cadeabd4 PTML doc: clarify supported and allowed actions 2025-09-10 18:48:06 +02:00
Pietro Fezzardi 82d0a17fe0 PTML doc: attribute categories are indepenent 2025-09-10 18:48:05 +02:00
Alessandro Di Federico ccb0180f13 Merge branch 'feature/debug-info-preservation-2' 2025-09-10 17:44:30 +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 385cbfb13a Introduce ModuleSlotTracker-aware dumpToString 2025-09-10 17:44:02 +02:00
Ivan Krysak 374ee341fa Remove an unused logger 2025-09-10 17:44:02 +02:00
Ivan Krysak f4227dba42 Adopt isDebugLocationInvalid 2025-09-10 17:44:02 +02:00
Pietro Fezzardi 03e0de9458 Improve debug info propagation in legacy pipeline 2025-09-10 17:44:02 +02:00
Ivan Krysak 4d35551f14 Introduce a debug information preservation style
It's guarded behind the
`EnableStrictDebugInformationPreservationStyle`
option.
2025-09-10 17:44:02 +02:00
Ivan Krysak 6d4849bd96 Do not open an unused file stream
The std streams in question is never used, as an llvm stream
for the same files is opened right after.
2025-09-10 17:44:02 +02:00
Ivan Krysak dbd8a720b7 Reduce using namespace abuse 2025-09-10 17:44:02 +02:00
Ivan Krysak 1534476865 AttachDebugInfo: use isDebugLocationInvalid 2025-09-10 17:44:01 +02:00
Ivan Krysak f1ee21c2cd Introduce isDebugLocationInvalid helper 2025-09-10 17:44:01 +02:00
Ivan Krysak b456e3a25d AttachDebugInfo: set dispatcher debug information
This attaches default (function entry point) debug information to
the artificial dispatcher basic block.
2025-09-10 17:44:01 +02:00
Ivan Krysak cf7bf102a7 AttachDebugInfo: set "default" debug information
This attaches debug information pointing to the function entry point
to every instruction that precedes the very first `newpc` marker.
2025-09-10 17:44:01 +02:00
Ivan Krysak f5d2edf744 AttachDebugInfo: refactor 2025-09-10 17:44:01 +02:00
Ivan Krysak ef434e46f8 LocalVariableBuilder: preserve debug information 2025-09-10 17:44:01 +02:00
Ivan Krysak 5bc4ae45de RemoveExceptionalCalls: preserve debug information 2025-09-10 17:44:01 +02:00
Ivan Krysak 957d861918 HoistStructPhis: preserve debug information 2025-09-10 17:44:01 +02:00
Ivan Krysak 6113f7f6eb ExitSSA: preserve debug information 2025-09-10 17:44:01 +02:00
Ivan Krysak 2ad2cbda6f setInsertPointToFirstNonAlloca: preserve DebugLoc 2025-09-10 17:44:01 +02:00