-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
68 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// RUN: rm -f %t.ll | ||
// RUN: %thorin %s --output-ll %t.ll -o - | ||
|
||
.plugin mem; | ||
.plugin math; | ||
.plugin autodiff; | ||
|
||
.fun f(a: %math.F32): %math.F32 = return (%math.arith.add 0 (a, a)); | ||
|
||
.con .extern main [mem : %mem.M, argc : .I32, argv : %mem.Ptr (%mem.Ptr (.I8, 0), 0), return : .Cn [%mem.M, %math.F32]] = | ||
.con ret_cont r: %math.F32 = return (mem, r); | ||
.let c = 43:%math.F32; | ||
f (c,ret_cont); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,12 @@ | ||
// RUN: rm -f %t.ll | ||
// RUN: %thorin -e thorin %s -e ll -o %t | FileCheck %s | ||
// RUN: %thorin %s --output-ll %t.ll -o - | ||
// RUN: clang %t.ll -o %t -Wno-override-module | ||
|
||
.plugin core; | ||
.plugin matrix; | ||
|
||
.con .extern f [mem : %mem.M, | ||
[k:.Nat, l:.Nat], | ||
M:%matrix.Mat (2,(k,l),.I32), | ||
return: .Cn[%mem.M, .I32]] = { | ||
|
||
.let two = %core.conv.u2u (k, .i32) 2I32; | ||
.let three = %core.conv.u2u (l, .i32) 3I32; | ||
|
||
.let (mem2,a) = %matrix.read | ||
(2, (k,l), .I32) | ||
( | ||
mem, | ||
M, | ||
(two,three) | ||
); | ||
|
||
return (mem2, a) | ||
}; | ||
.con .extern f(mem: %mem.M, [k: .Nat, l: .Nat], M: %matrix.Mat (2, (k, l), .I32), return: .Cn[%mem.M, .I32]) = | ||
.let two = %core.idx k 0 2; | ||
.let three = %core.idx l 0 3; | ||
.let (mem2,a) = %matrix.read (2, (k,l), .I32) (mem, M, (two, three)); | ||
return (mem2, a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// RUN: rm -f %t.ll | ||
// RUN: timeout 10 %thorin -p clos %s --output-ll %t.ll --output-thorin - | ||
|
||
.plugin core; | ||
.plugin mem; | ||
|
||
.let size = 100000000; | ||
|
||
.con .extern main(mem: %mem.M, argc: .I32, argv : %mem.Ptr («⊤:.Nat; %mem.Ptr («⊤:.Nat; .I8», 0)», 0), return : .Cn [%mem.M, .I32]) = | ||
.let (`mem, arr) = %mem.alloc (<<size; .I32>>, 0) mem; | ||
.let lea = %mem.lea (size, <size; .I32>, 0) (arr, %core.idx size 0 0); | ||
.let (`mem, val) = %mem.load (mem, lea); | ||
return (mem, 1I32); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.