Timon Kruiper
56c059077c
stage2: add initial impl of control flow in LLVM backend
The following TZIR instrutions have been implemented in the backend:
- all cmp operators (lt, lte, gt, gte, eq, neq)
- block
- br
- condbr
The following LLVMIR is generated for a simple assert function:
```
define void @assert(i1 %0) {
Entry:
%1 = alloca i1, align 1
store i1 %0, i1* %1, align 1
%2 = load i1, i1* %1, align 1
%3 = xor i1 %2, true
br i1 %3, label %Then, label %Else
Then: ; preds = %Entry
call void @llvm.debugtrap()
unreachable
Else: ; preds = %Entry
br label %Block
Block: ; preds = %Else
ret void
}
```
See tests for more examples.
2021-01-08 19:30:52 +01:00
..
2021-01-08 19:30:52 +01:00
2021-01-06 17:40:25 -07:00
2021-01-04 14:23:01 -08:00
2021-01-05 18:43:41 -07:00
2021-01-03 20:34:51 -07:00
2020-11-22 17:28:11 -07:00
2020-09-21 18:38:55 -07:00
2020-10-27 14:16:43 -07:00
2021-01-06 16:32:23 -08:00
2021-01-06 17:40:25 -07:00
2021-01-04 14:59:18 -07:00
2021-01-03 17:39:43 +01:00
2020-12-07 17:27:09 -07:00
2021-01-02 19:03:14 -07:00
2020-09-22 14:08:08 -07:00
2021-01-01 15:48:46 -07:00
2021-01-06 00:55:51 +11:00
2020-12-24 14:11:58 -07:00
2020-12-24 14:11:58 -07:00
2020-12-24 14:11:58 -07:00
2021-01-06 16:06:32 -08:00
2021-01-02 19:03:14 -07:00
2021-01-06 10:52:20 +01:00
2021-01-06 10:52:20 +01:00
2021-01-06 17:40:25 -07:00
2021-01-02 17:12:57 -07:00
2020-12-17 19:32:40 +01:00
2021-01-02 17:12:57 -07:00
2021-01-02 17:12:57 -07:00
2020-10-30 15:58:13 +02:00
2021-01-02 17:12:57 -07:00
2021-01-06 10:52:20 +01:00
2021-01-07 11:37:52 +01:00
2020-12-23 16:57:18 -08:00
2020-09-21 18:38:55 -07:00
2021-01-06 00:55:51 +11:00
2021-01-02 19:03:14 -07:00
2020-09-21 18:38:55 -07:00
2021-01-02 19:10:11 -07:00
2020-12-23 16:57:18 -08:00
2018-09-18 00:13:17 -04:00
2018-10-27 11:35:01 -04:00
2020-09-21 21:14:01 -07:00
2020-09-21 18:38:55 -07:00
2020-07-24 17:01:52 -07:00
2020-07-24 17:01:52 -07:00
2020-07-24 17:01:52 -07:00
2020-10-27 14:16:43 -07:00
2021-01-03 17:23:30 +01:00
2020-12-24 01:18:48 -07:00
2020-12-24 01:18:48 -07:00
2021-01-05 18:43:41 -07:00
2021-01-08 12:13:27 +01:00