|
|
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: 2286 (0x8ee)
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;
----------------
-- Constant Folding
----------------
-- This test evaluates a code improvement potential that results
-- from the elimination of operations that compute expressions
-- comprised of constant values.
-- The optimized test procedure redefines Global_1 and Global_2 with
-- constant values, Constant_1 and Constant_2. Global_1 and
-- Global_2 are immediately used as expression operands to redefine
-- Global_3 and Global_4, thereby allowing their values to be
-- propagated for the compile-time evaluation of the constant
-- expressions.
-- The nonoptimized test procedure inhibits the optimization by
-- introducing a call to a procedure in the basic block that
-- necessitates the execution-time evaluation of the expressions
-- since the values of Global_1 and Global_2 can no longer be safely
-- propagated.
procedure Opcfa2 is
package New_Procs is new Procs (Integer);
use New_Procs;
Global_1 : T;
Global_2 : T;
Global_3 : T;
Global_4 : T;
Constant_1 : constant T := Init / Init;
Constant_2 : constant T := Init / Init + Init / Init;
procedure Break_Basic_Block is
begin
Let (Global_1, Ident (Init / Init));
Let (Global_2, Ident (Init / Init));
Let (Global_3, Ident (Init / Init));
Let (Global_4, Ident (Init / Init));
end Break_Basic_Block;
begin
Start ("OPCFA2", "Optiomization Perf., Constant Folding (test)");
for I in 1 .. 1000 loop
Let (Global_1, Ident (Init / Init));
Let (Global_2, Ident (Init / Init));
Let (Global_3, Ident (Init / Init));
Let (Global_4, Ident (Init / Init));
Global_1 := Constant_1;
Global_2 := Constant_2;
-- Break_Basic_Block; -- included in control version
------optimize-----
Global_3 := Global_1 + Global_2;
------optimize-----
Global_4 := Global_1 * Global_2;
Break_Basic_Block; -- included in test version
Let (Global_1, Ident (Init / Init));
Let (Global_2, Ident (Init / Init));
Let (Global_3, Ident (Init / Init));
Let (Global_4, Ident (Init / Init));
end loop;
Stop;
end Opcfa2;