Loop fusion

Loop fusion

Loop fusion, also called loop jamming, is a compiler optimization, a loop transformation, which replaces multiple loops with a single one.

Example in C

int i, a [100] , b [100] ; for (i = 0; i < 100; i++) { a [i] = 1; } for (i = 0; i < 100; i++) { b [i] = 2; }

is equivalent to:

int i, a [100] , b [100] ; for (i = 0; i < 100; i++) { a [i] = 1; b [i] = 2; }

Note

Some optimizations like this don't always improve the run-time performance. This is due to architectures that provide better performance if there are two loops rather than one, for example due to increased data locality within each loop. In those cases, a single loop may be transformed into two, which is called loop fission.

External links

* [http://www.nullstone.com/htmls/category/fusion.htm NullStone Loop Fusion]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Loop unwinding — Loop unwinding, also known as loop unrolling, is a loop transformation technique that attempts optimize a program s execution speed at the expense of its size.The goal of loop unwinding is to increase the programs speed by reducing (or… …   Wikipedia

  • Fusion — can refer to combining two or more distinct things *Cell fusion *Freezing, a chemistry term for a liquid undergoing a phase change into a solid *Gene fusion, a genetic event and molecular biology technique *Nuclear fusion, the process by which… …   Wikipedia

  • Loop fission — (or loop distribution) is a compiler optimization technique attempting to break a loop into multiple loops over the same index range but each taking only a part of the loop s body. The goal is to break down large loop body into smaller ones to… …   Wikipedia

  • Loop optimization — In compiler theory, loop optimization plays an important role in improving cache performance, making effective use of parallel processing capabilities, and reducing overheads associated with executing loops. Most execution time of a scientific… …   Wikipedia

  • Loop interchange — In compiler theory, loop interchange is the process of exchanging the order of two iteration variables. For example, in the code fragment: for i from 0 to 10 for j from 0 to 20 a [i,j] = i + jloop interchange would result in: for j from 0 to 20… …   Wikipedia

  • Loop dependence analysis — In compiler theory, loop dependence analysis is the task of determining whether statements within a loop body form a dependence, almost always with respect to array access and modification. For a normalized loop: for i1 from l1 to u1 do for i2… …   Wikipedia

  • Normalized loop — In computer science, a normalized loop (sometimes called well behaved loop), is a loop which the loop variable starts at 0 (or any constant) and get incremented by one at every iteration until the exit condition is met. Normalized loops are very… …   Wikipedia

  • nuclear fusion — fusion (def. 4). [1895 1900] * * * Process by which nuclear reactions between light elements form heavier ones, releasing huge amounts of energy. In 1939 Hans Bethe suggested that the energy output of the sun and other stars is a result of fusion …   Universalium

  • Union Loop — 41°52′48″N 87°38′47″O / 41.88, 87.64639 …   Wikipédia en Français

  • Ford Fusion Hybrid — Manufacturer Ford Motor Company Production 2009– Assembly Hermosillo, Sonora, Mexico …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”