diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-04-11 16:18:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-11 16:18:29 -0700 |
| commit | baf194e7456ba4568dcf11249896af35b3ce18cc (patch) | |
| tree | f75e20db450100d41bfa9c384a8bab0fdc28a749 /tests/ir | |
| parent | 6322983fa4dc84ef1e9dd8fad54d4c1580436e67 (diff) | |
Introduce an IR-level type system (#481)
* Introduce an IR-level type system
Up to this point, the Slang IR has used the front-end type system to represent types in the IR.
As a result (but ultimately more importantly) the IR representation of generics and specialization has used AST-level concepts embedded in the IR.
For example, to express the specialization of `vector<T,N>` to a concrete type `float` for `T`, we needed an IR operation that could represent the specialization, with operands that somehow represented the type argument `float`.
The whole thing was very complicated.
The big idea of this change is to introduce a new representation in which types in the IR are just ordinary instructions, so that using them as operands makes sense. The hierarchy of IR types closely mirrors the AST-side hierarchy for now, and that will probably be something we should maintain going forward.
In order to make these changes work, though, I also had to do major overhauls of things like the way substitutions are performed, how we check interface conformances, the way lookup through interface types is done, etc. etc. This is a big change, and unfortunately any attempt to summarize it in the commit message wouldn't do it justice.
* Fix 64-bit build warning
* Fix up some clang warnings/errors
Diffstat (limited to 'tests/ir')
| -rw-r--r-- | tests/ir/factorial.slang | 12 | ||||
| -rw-r--r-- | tests/ir/loop.slang | 12 |
2 files changed, 22 insertions, 2 deletions
diff --git a/tests/ir/factorial.slang b/tests/ir/factorial.slang index 0ceff29bd..76653f055 100644 --- a/tests/ir/factorial.slang +++ b/tests/ir/factorial.slang @@ -1,4 +1,14 @@ -//TEST:EVAL: +//TEST_DISABLED:EVAL: + +// Note: This test has been disabled as part of introducing +// the IR-level type system, because it changes the overall +// structure of IR moduels quite a bit, and no user code +// actually relies on the serialized IR or VM. +// +// This test should ideally be re-enabled once work is +// done to revamp the serialized bytecode format into +// something more essential to the compiler (e.g., for +// modular separate compilation). StructuredBuffer<int> input; RWStructuredBuffer<int> output; diff --git a/tests/ir/loop.slang b/tests/ir/loop.slang index ddbd7ecb0..32eb41f1b 100644 --- a/tests/ir/loop.slang +++ b/tests/ir/loop.slang @@ -1,4 +1,14 @@ -//TEST:SIMPLE:-dump-ir -profile cs_5_0 -entry main +//TEST_DISABLED:SIMPLE:-dump-ir -profile cs_5_0 -entry main + +// Note: disabling this test for now because +// the actual IR that gets dumped is not very +// stable with code generation changes going on, +// and we already have more significant tests +// that stress the IR functionality. +// +// We should consider removing this test, or +// else work to ensure that "canonical" IR +// output is more consistent. #define GROUP_THREAD_COUNT 64 |
