571 Commits

Author SHA1 Message Date
Lauri Vasama b9ce0a87df Add Clift model verification 2025-07-17 16:45:03 +02:00
Lauri Vasama fa184b9212 Add Clift backend support for pointer sizes 2025-07-17 16:45:03 +02:00
Lauri Vasama 3b58a5bf4e Fix StackArgumentsType to Clift import
The stack argument was previously imported as a pointer.
2025-07-17 16:45:03 +02:00
Lauri Vasama fc682383e9 Implement Clift bytecode
Fixes bytecode emission of class types with very large trees of members.
See the new unit test: union-with-large-tree.mlir .
2025-07-17 16:45:03 +02:00
Lauri Vasama 936c0106e4 Add truncate/extend between pointers 2025-07-17 16:45:03 +02:00
Lauri Vasama 50c3c8f95a Fix Clift union recursion parsing issue 2025-07-17 16:45:03 +02:00
Giacomo Vercesi d62b7b6b1a TTG: inline root type in schema
Move the root type inside the schema definition, as it is a property of
it and not of the generator.
2025-06-25 15:40:13 +02:00
Andrea Gussoni 3527291bd9 IDS: multiple divergence implementation
Perform the IDS transformation, by taking into account possible multiple
divergent scopes for a certain conditional node at the same time.

This reduces the run times, since it reduces the number of time IDS is
called on a conditional, but mostly proceduce a more _compact_
`ScopeGraph`, where all the divergent scopes for a certain conditional
node rejoing the path toward the one true exit in a single point,
instead of having a chain of IDS resulting regions.

Make IDS unit tests compliant with the new multiple divergence
implementation.
2025-06-12 15:31:38 +02:00
Lauri Vasama c956904b8e Add Clift backend pipe and update tests 2025-06-04 15:13:47 +02:00
Lauri Vasama 73ca618c4d Simplify import-clift-types pipe and tests 2025-06-04 15:13:47 +02:00
Lauri Vasama cc94e2d290 Constrain returnable types 2025-06-04 15:13:47 +02:00
Lauri Vasama 047511b1ed Remove Clift break and continue ops 2025-06-04 15:13:47 +02:00
Lauri Vasama 3e065cb23d Remove local and label names 2025-06-04 15:13:47 +02:00
Lauri Vasama f0091e699f Remove clift::ModuleOp
A new dialect attribute is instead used to verify mlir::ModuleOp:

```
module attributes {clift.module} {
}
```
2025-06-04 15:13:47 +02:00
Lauri Vasama 336b18d937 Overhaul Clift type syntax
* Removed syntax for defined type attributes.
* Added !clift.const<T> and removed const syntax from types kinds.
* Some restructuring of class type internals.
2025-06-04 15:13:47 +02:00
Lauri Vasama 893ca56921 Require separate output arguments in revng pipe
Each mutable container used by the pipe now requires a separator output
path argument.
2025-06-04 15:13:47 +02:00
Ivan Krysak eac296a99f Standardize PTML tag emission in c backend 2025-05-08 15:42:00 +02:00
Ivan Krysak 0d868894a2 model::Function: switch to indices as comment keys 2025-05-08 15:42:00 +02:00
Andrea Gussoni 80df1f3a42 MTGoTo: add unit test leveraging IDS ordering 2025-04-30 16:10:54 +02:00
Andrea Gussoni 6951611082 MTGoTo: introduce unit test 2025-04-30 16:10:54 +02:00
Andrea Gussoni 8ff68174ea ScopeGraph: use snake_case for Markers 2025-04-30 16:10:54 +02:00
Andrea Gussoni 71988af041 Fix MIT license 2025-04-30 16:10:54 +02:00
Khaled Ismaeel 030becfeba Adapt the build to the new schema version field
This is a followup to the commit where we introduced the `version`
field in the schema YAML.
2025-04-30 15:08:45 +02:00
Khaled Ismaeel 383af5b6b0 Add the version field to schemas YAML
Here we start restructuring the the schemas YAML such that it
contains a top-level `version` field. In this commit we only modify
the YAML, the build system changes will come later, to avoid
enormous commits.
2025-04-30 15:08:45 +02:00
Khaled Ismaeel 531d9b866c Remove the now-redundant HEADERS list 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 53a5ff07cf Remove embedded TUPLE-TREE-YAML 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 63469c9cd6 Use unified YAML schemas in the build process
In this commit we instruct the build system to use the unified schema
files  instead of collecting the `TUPLE-TREE-YAML` comments.

The fixes to C++ files are necessary because they depend on the order
of the fields in the schema, which was changed.
2025-04-30 15:08:45 +02:00
Khaled Ismaeel f384b10435 Check schemas into the codebase
These schema files are currently generated at build time by
collecting various TUPLE-TREE-YAML comments using the
`extract_yaml.py` script. In this commit we move them to the codebase
but we don't use them yet, this will be done at a later commit for
the sake of readability.
2025-04-30 15:08:40 +02:00
Ivan Krysak 79964eac74 Avoid ' misuse in error messages and comments 2025-04-17 16:41:21 +02:00
Ivan Krysak 47a1869695 tests: ensure architecture is always available 2025-04-17 11:19:17 +03:00
Ivan Krysak dce5c1a02c NamingConfiguration: pull more prefixes inside
Unify additional values that used to be hardcoded in the old backend
under the same naming configuration root.
2025-04-17 11:19:17 +03:00
Ivan Krysak f070f1f1e1 Model: sunset double name system 2025-04-17 11:19:17 +03:00
Alessandro Di Federico de2a96c34c AVI: set the extremal value ot top 2025-04-15 15:31:10 +02:00
Giacomo Vercesi 11f1e532c6 Implement dirty bit on Container
Add a `Dirty` boolean to the `ContainerBase` class. This will be set to
true when the container mutates itself (e.g. remove, mergeBack, clear).
The dirty bit is reset when running `PipelineManager.store`.
2025-04-03 15:59:18 +02:00
Andrea Gussoni 3d5ec32113 IDS: add unit tests
Add unit tests for the `InlineDivergentScopes` pass alone.
2025-04-02 16:47:14 +02:00
Andrea Gussoni dadfbc27da SelectScope: add unit tests
Add unit tests for the `SelectScope` pass alone.
2025-04-02 16:47:14 +02:00
Andrea Gussoni e0ff6f1360 ESE: extend command line flag 2025-04-02 16:47:14 +02:00
Lauri Vasama 3ca3653333 Convert Clift type handles to use locations 2025-03-24 09:27:57 +02:00
Lauri Vasama e9c329e51d Rename Clift unique handle to handle 2025-03-24 09:26:43 +02:00
Lauri Vasama 5479a5de88 Add special handling of aggregate initializers 2025-03-24 09:26:43 +02:00
Lauri Vasama 2f64025dc9 Fix Clift backend double negation emission 2025-03-24 09:26:43 +02:00
Lauri Vasama 5f475739ef Rename reinterpret, add convert cast 2025-03-24 09:26:43 +02:00
Lauri Vasama f884642f59 Overhaul clift.struct, clift.union assembly syntax
Old syntax:
```
	unique_handle = "/model-type/1",
	name = "my_struct",
	size = 2,
	fields = [
		<
			offset = 0
			name = "",
			type = !t
		>,
		<
			offset = 1,
			name = "my_field",
			type = !t
		>
	]
>

	unique_handle = "/model-type/1",
	name = "my_union",
	fields = [
		<
			offset = 0,
			name = "",
			type = !t
		>,
		<
			offset = 0,
			name = "my_field",
			type = !t
		>
	]
>
```

New syntax:
```
	"/model-type/1" as "my_struct" : size(1) {
		offset(0) : !t,
		offset(1) as "my_field" : !t
	}
>

	"/model-type/1" as "my_union" : {
		!t,
		"my_field" : !t
	}
>
```
2025-03-24 09:26:43 +02:00
Lauri Vasama 5bd481ae5a Overhaul clift.function assembly syntax
Old syntax:
```
        unique_handle = "/model-type/1",
        name = "my_function",
        return_type = !t,
        argument_types = [
                !t
        ]
>
```

New syntax:
```
        "/model-type/1" as "my_function" : !t(!t)
>
```

* Rename clift.function mnemonic to clift.func.
2025-03-24 09:26:43 +02:00
Lauri Vasama 281bf283e2 Overhaul clift.typedef assembly syntax
Old syntax:
```
	unique_handle = "/model-type/1",
	name = "my_typedef",
	underlying_type = !t
>
```

New syntax:
```
	"/model-type/1" as "my_typedef" : !t
>
```
2025-03-24 09:26:43 +02:00
Lauri Vasama ea78766f10 Overhaul clift.enum assembly syntax
Old syntax:
```
	unique_handle = "/model-type/1",
	name = "my_enum",
	underlying_type = !t,
	fields = [
		<
			name = "my_enumerator",
			raw_value = 42
		>
	]
>
```

New syntax:
```
	"/model-type/1" as "my_enum" : !t {
		42 as "my_enumerator"
	}
>
```
2025-03-24 09:26:43 +02:00
Lauri Vasama 8482bcbf90 Overhaul clift.defined assembly syntax
Old syntax:
```
!clift.defined<#t>
!clift.defined<is_const = true, #t>
```

New syntax:
```
!clift.defined<#t>
!clift.defined<const #t>
```
2025-03-24 09:26:43 +02:00
Lauri Vasama 64fc21e9dd Overhaul clift.pointer assembly syntax
Old syntax:
```
!clift.pointer<pointer_size = 8, pointee_type = !t>
!clift.pointer<is_const = true, pointer_size = 8, pointee_type = !t>
```

New syntax:
```
!clift.ptr<8 to !t>
!clift.ptr<const 8 to !t>
```
2025-03-24 09:26:43 +02:00
Lauri Vasama 872b157774 Overhaul clift.array assembly syntax
Old syntax:
```
!clift.array<elements_count = 42, element_type = !t>
```

New syntax:
```
!clift.array<42 x !t>
```
2025-03-24 09:26:43 +02:00
Lauri Vasama eaf1bf35aa Overhaul clift.primitive assembly syntax
Old syntax:
```
!clift.primitive<SignedKind 8>
!clift.primitive<is_const = true, SignedKind 8>
```

New syntax:
```
!clift.primitive<signed 8>
!clift.primitive<const signed 8>
```
2025-03-24 09:26:43 +02:00