About: Loop unswitching     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : yago:YagoPermanentlyLocatedEntity, within Data Space : dbpedia.demo.openlinksw.com associated with source document(s)
QRcode icon
http://dbpedia.demo.openlinksw.com/describe/?url=http%3A%2F%2Fdbpedia.org%2Fresource%2FLoop_unswitching&invfp=IFP_OFF&sas=SAME_AS_OFF

Loop unswitching is a compiler optimization. It moves a conditional inside a loop outside of it by duplicating the loop's body, and placing a version of it inside each of the if and else clauses of the conditional. This can improve the parallelization of the loop. Since modern processors can operate quickly on vectors, this improvement increases the speed of the program. Here is a simple example. Suppose we want to add the two arrays x and y and also do something depending on the variable w. We have the following C code: Loop unswitching was introduced in gcc in version 3.4.

AttributesValues
rdf:type
rdfs:label
  • Loop unswitching (en)
  • Размыкание цикла (ru)
  • 迴圈判斷外提 (zh)
rdfs:comment
  • Размыкание цикла (англ. loop unswitching) состоит в вынесении условия за пределы цикла и дублирования тела цикла с помещением соответствующих вариантов в соответствующие ветви условия. Это позволяет улучшить производительность за счёт того, что современные процессоры могут выполнять векторные операции (данное оптимизирующее преобразование может быть выполнено совместно с размоткой цикла, а результатом размотки, в свою очередь, являются несколько операций в итерации, производимые над последовательными участками памяти, которые можно заменить одной векторной, если это позволяет архитектура; так, например, делается в ICC). Кроме того, это позволяет более эффективно выполнить цикл параллельно. (ru)
  • 迴圈判斷外提(英語:loop unswitching)是一種的方法。迴圈判斷外提將迴圈中的條件式移到迴圈之外,在「若」與「否則」式裡各放置一個原來迴圈的內容。這可以增進迴圈平行處理的可能性。 以下是一個簡單的例子。若程式碼想要將陣列 x、y 相加,並根據變數 w 做別的事,就有這種 C 的程式碼: int i, w, x[1000], y[1000]; for (i = 0; i < 1000; i++) { x[i] = x[i] + y[i]; if (w) y[i] = 0; } 因為有迴圈裡的條件式,要安全的平行處理這個迴圈變得很困難。若進行判斷外提,這個迴圈會變成: int i, w, x[1000], y[1000]; if (w) { for (i = 0; i < 1000; i++) { x[i] = x[i] + y[i]; y[i] = 0; } } else { for (i = 0; i < 1000; i++) { x[i] = x[i] + y[i]; } } 雖然迴圈外提會讓程式碼的量加倍,現在各個迴圈可以分別進行最佳化。 迴圈外提在版本 3.4 引入 GCC。 (zh)
  • Loop unswitching is a compiler optimization. It moves a conditional inside a loop outside of it by duplicating the loop's body, and placing a version of it inside each of the if and else clauses of the conditional. This can improve the parallelization of the loop. Since modern processors can operate quickly on vectors, this improvement increases the speed of the program. Here is a simple example. Suppose we want to add the two arrays x and y and also do something depending on the variable w. We have the following C code: Loop unswitching was introduced in gcc in version 3.4. (en)
dcterms:subject
Wikipage page ID
Wikipage revision ID
Link from a Wikipage to another Wikipage
sameAs
dbp:wikiPageUsesTemplate
has abstract
  • Loop unswitching is a compiler optimization. It moves a conditional inside a loop outside of it by duplicating the loop's body, and placing a version of it inside each of the if and else clauses of the conditional. This can improve the parallelization of the loop. Since modern processors can operate quickly on vectors, this improvement increases the speed of the program. Here is a simple example. Suppose we want to add the two arrays x and y and also do something depending on the variable w. We have the following C code: int i, w, x[1000], y[1000]; for (i = 0; i < 1000; i++) { x[i] += y[i]; if (w) y[i] = 0; } The conditional inside this loop makes it difficult to safely parallelize this loop. When we unswitch the loop, this becomes: int i, w, x[1000], y[1000]; if (w) { for (i = 0; i < 1000; i++) { x[i] += y[i]; y[i] = 0; } } else { for (i = 0; i < 1000; i++) { x[i] += y[i]; } } While the loop unswitching may double the amount of code written, each of these new loops may now be separately optimized. Loop unswitching was introduced in gcc in version 3.4. (en)
  • Размыкание цикла (англ. loop unswitching) состоит в вынесении условия за пределы цикла и дублирования тела цикла с помещением соответствующих вариантов в соответствующие ветви условия. Это позволяет улучшить производительность за счёт того, что современные процессоры могут выполнять векторные операции (данное оптимизирующее преобразование может быть выполнено совместно с размоткой цикла, а результатом размотки, в свою очередь, являются несколько операций в итерации, производимые над последовательными участками памяти, которые можно заменить одной векторной, если это позволяет архитектура; так, например, делается в ICC). Кроме того, это позволяет более эффективно выполнить цикл параллельно. (ru)
  • 迴圈判斷外提(英語:loop unswitching)是一種的方法。迴圈判斷外提將迴圈中的條件式移到迴圈之外,在「若」與「否則」式裡各放置一個原來迴圈的內容。這可以增進迴圈平行處理的可能性。 以下是一個簡單的例子。若程式碼想要將陣列 x、y 相加,並根據變數 w 做別的事,就有這種 C 的程式碼: int i, w, x[1000], y[1000]; for (i = 0; i < 1000; i++) { x[i] = x[i] + y[i]; if (w) y[i] = 0; } 因為有迴圈裡的條件式,要安全的平行處理這個迴圈變得很困難。若進行判斷外提,這個迴圈會變成: int i, w, x[1000], y[1000]; if (w) { for (i = 0; i < 1000; i++) { x[i] = x[i] + y[i]; y[i] = 0; } } else { for (i = 0; i < 1000; i++) { x[i] = x[i] + y[i]; } } 雖然迴圈外提會讓程式碼的量加倍,現在各個迴圈可以分別進行最佳化。 迴圈外提在版本 3.4 引入 GCC。 (zh)
gold:hypernym
prov:wasDerivedFrom
page length (characters) of wiki page
foaf:isPrimaryTopicOf
is differentFrom of
is Link from a Wikipage to another Wikipage of
is foaf:primaryTopic of
Faceted Search & Find service v1.17_git139 as of Feb 29 2024


Alternative Linked Data Documents: ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3330 as of Mar 19 2024, on Linux (x86_64-generic-linux-glibc212), Single-Server Edition (378 GB total memory, 59 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software