|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 2455 (0x997)
Types: TextFile
Names: »B«
└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
└─⟦5cb1d1d7f⟧ »DATA«
└─⟦3b1ee7bd8⟧
└─⟦this⟧
with Instrument;
use Instrument;
----------------------
-- Expression Computation
----------------------
-- This test evaluates a code improvement potential that results
-- from minimizing the execution of an arithmetic computation when
-- the opportunity is offered to relocate an invariant expression
-- outside the region of code for a loop body.
-- The test procedures contain a single loop that encloses a
-- camouflaged redefinition of a local variable, Local_1. The
-- redefinition requires the evaluation of an expression which in
-- the optimized test procedure includes an invariant computation
-- using local variables. In the nonoptimized test procedure one of
-- the local variables in the invariant expression is replaced by
-- the redefined local variable. Consequently, only in the
-- optimized test procedure is there an invariant computation that
-- can be relocated. This relocation should be evident from the
-- difference in the execution time of the two procedures and
-- possibly by a difference in space requirements for the two
-- procedure bodies.
-- Local variables are used in the invariant expression to increase
-- the likelihood of detecting the optimization, however the values
-- of these local variables are determined at execution time to
-- ensure the maximum benefit from the code improvement. A
-- camouflaged assignment of Local_1 to a global variable ensures
-- that its redefinition is not eliminated as a further
-- optimization.
procedure Loeca1 is
package New_Procs is new Procs (Integer);
use New_Procs;
Local_1, Local_2, Local_3 : T := Ident (Init / Init);
begin
Start ("LOECA1", "Loop Optimization, Expr. Calc. (control)");
for I in 1 .. 10000 loop
Let (Global, Ident (Init));
for J in Ident (T'Val (1)) .. Ident (T'Val (10)) loop
-----optimize----
-- Let(Local_1, Ident(T(T(Local_2 * Local_3)/Local_1)));
-- included in test version
Let (Local_2, Ident (T (T (Local_2 * Local_3) / Local_1)));
-- included in control version
end loop;
-- Let(Global, Ident(Local_1));
-- included in test version
-- Let(Global, Ident(Local_2));
-- included in control version
Let (Global, Ident (Init));
end loop;
Stop;
end Loeca1;