DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦169ed41b8⟧ TextFile

    Length: 2080 (0x820)
    Types: TextFile
    Names: »B«

Derivation

└─⟦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⟧ 

TextFile

with Instrument;
use Instrument;

----------
-- Assignment
----------

--  This test evaluates a code  improvement  potential  that  results
--  from  simplifying  loop  computations  when  the  opportunity  is
--  offered to relocate all repetitive operations  outside  the  code
--  region of a loop body.

--  The two  test  procedures  contain  a  single  loop  enclosing  a
--  redefinition   of  a  local  variable.   In  the  optimized  test
--  procedure the redefinition uses an invariant  expression  whereas
--  the   nonoptimized   test   procedure  uses  an  expression  that
--  references  the  redefined  local  variable.   Consequently,  the
--  optimization  is  evidenced by a difference in both the execution
--  time and space requirements of the two procedures since the  loop
--  can be simplified when the redefinition is invariant.

--  Because of the camouflaged evaluation of the discrete range,  all
--  loop   operations   cannot   be   eliminated.    The  camouflaged
--  redefinition of Global_1 ensures that the  loop  redefinition  is
--  not eliminated from both test procedures.

procedure Loaea2 is

    package New_Procs is new Procs (Integer);
    use New_Procs;

    One : constant T := T (Init / Init);
    Two : constant T := One + One;

    Local_1, Local_2, Local_3 : T := Ident (Init / Init);

begin

    Start ("LOAEA2", "Loop Optimization, Asst. Eval. (test)");
    for I in 1 .. 10000 loop

        Let (Global, Ident (Init));

        for J in Ident (T'Val (1)) .. Ident (T'Val (10)) loop

            ---------------optimize----------------
            Local_1 := T ((Local_2 + Local_3) /
                          Two);  -- included in test version
            --     Local_2 := T((Local_2 + Local_3) / Two);  -- 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 Loaea2;