Commit Graph

729 Commits

Author SHA1 Message Date
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 2d5731b363 Add migration test 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 7156cace7b Drop multiversion support in Python model wrapper 2025-04-30 15:08:45 +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 57b5eb7f98 NameBuilder: allow different name checkers 2025-04-17 11:19:17 +03: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 1115319463 ABI-tests: adjust name checking asserts
Since `NameBuilder::name` can never return an empty string, these can
never fail. But instead of removing them, it's safer to check whether
all the functions have a "real" name coming from the debug information
instead.
2025-04-17 11:19:17 +03:00
Ivan Krysak f070f1f1e1 Model: sunset double name system 2025-04-17 11:19:17 +03:00
Ivan Krysak 645cf7fc2e NameBuilder: sunset deduplication
This reworks NameBuilder to ease the transition to the system where
the model will be guaranteed to never contain any name collisions, both
between user-specified names and the automatic ones.
2025-04-15 16:35:42 +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
Lauri Vasama e08a8e766b Set register set type name in Clift import 2025-03-24 09:26:43 +02:00
Lauri Vasama 20cb57a105 Fix redundant cast parentheses in Clift backend 2025-03-24 09:26:42 +02:00
Lauri Vasama 23b47f825e Add Clift AggregateOp 2025-03-24 09:17:38 +02:00
Lauri Vasama bf625c631a Improve Clift CallOp syntax 2025-03-24 09:17:36 +02:00
Lauri Vasama 1b63797640 Add Clift TernaryOp 2025-03-19 12:57:22 +02:00
Lauri Vasama 747a792f0f Add Clift pointer arithmetic ops 2025-03-19 12:57:22 +02:00
Lauri Vasama 66246218b7 Add Clift StringOp 2025-03-19 12:57:21 +02:00
Lauri Vasama 888d529d93 Fix Clift return type verification 2025-03-19 12:57:20 +02:00
Lauri Vasama 08c2c0a477 Remove ScalarTupleType
After converting type IDs to unique handles it was decided to remove
scalar tuple types in favour of generated structs with non-model unique
handles.
2025-03-19 12:57:18 +02:00
Lauri Vasama 386efffb2f Convert TypeDefinitionAttr ID to UniqueHandle 2025-03-19 12:57:17 +02:00
Lauri Vasama 86126db366 Fix Clift composite type verify on parsing 2025-03-19 12:57:17 +02:00
Andrea Gussoni 93f4a620dd DAGify: implement the DAGify pass
Implement the DAGify pass. This pass, using the results exposed by the
`GenericRegionInfo` analysis, transforms all the retreating edges of
each identified `GenericRegion`, processed in a bottom-up fashion, into
a `goto` edge on the `ScopeGraph`.
2025-03-11 12:26:36 +01:00
Andrea Gussoni 7c8d581271 ESE: fix unit test 2025-03-11 12:25:24 +01:00