This file contains hidden or 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
var sum: int; | |
for i in vectorizeOnly(1..n) { | |
sum += i; // is sum "order independent" ? Is there a loop-carried dependency to respect? | |
// say it turns in to | |
// %1 = load %sum | |
// %2 = add %1, i | |
// store %2, %sum | |
// would it be wrong to assert there is no loop-carried dependency? | |
} |
This file contains hidden or 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
record R { | |
var x: int; | |
proc deinit() { | |
writeln("Destroying ", x); | |
} | |
} | |
proc foo() { | |
var count = 0; |
This file contains hidden or 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
/* compile with ldc2 a.d */ | |
module a; | |
import std.stdio; | |
@safe | |
int main() | |
{ | |
int[] array; | |
array.length = 7; |
NewerOlder