blob: 3bd06e7de762beb7519873fde20a89419a7c9fd5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
-- { dg-do compile }
-- { dg-options "-O -fdump-tree-cunroll-details" }
package body Unroll3 is
function "+" (X, Y : Sarray) return Sarray is
R : Sarray;
begin
for I in Sarray'Range loop
pragma Loop_Optimize (Unroll);
R(I) := X(I) + Y(I);
end loop;
return R;
end;
procedure Add (X, Y : Sarray; R : out Sarray) is
begin
for I in Sarray'Range loop
pragma Loop_Optimize (Unroll);
R(I) := X(I) + Y(I);
end loop;
end;
end Unroll3;
-- { dg-final { scan-tree-dump-times "loop with 3 iterations completely unrolled" 2 "cunroll" } }
|