An Entity of Type: ChangeOfState100199130, from Named Graph: http://dbpedia.org, within Data Space: dbpedia.org

In compiler theory, loop interchange is the process of exchanging the order of two iteration variables used by a nested loop. The variable used in the inner loop switches to the outer loop, and vice versa. It is often done to ensure that the elements of a multi-dimensional array are accessed in the order in which they are present in memory, improving locality of reference. For example, in the code fragment: for i from 0 to 10 for j from 0 to 20 a[i,j] = i + j loop interchange would result in: for j from 0 to 20 for i from 0 to 10 a[i,j] = i + j

Property Value
dbo:abstract
  • In compiler theory, loop interchange is the process of exchanging the order of two iteration variables used by a nested loop. The variable used in the inner loop switches to the outer loop, and vice versa. It is often done to ensure that the elements of a multi-dimensional array are accessed in the order in which they are present in memory, improving locality of reference. For example, in the code fragment: for i from 0 to 10 for j from 0 to 20 a[i,j] = i + j loop interchange would result in: for j from 0 to 20 for i from 0 to 10 a[i,j] = i + j On occasion, such a transformation may create opportunities to further optimize, such as automatic vectorization of the array assignments. (en)
  • Перестановка циклов (англ. Loop interchange) — оптимизация компилятора при которой меняется порядок итерационных переменных, относящихся к группе вложенных циклов. Итерационная переменная, используемая во внутреннем цикле, перемещается во внешний цикл, и наоборот. Это часто делается, чтобы гарантировать, что элементы многомерных массивов доступны в том порядке, в котором они хранятся в памяти, т.е. для улучшения локальности ссылок. Например, следующий код: for (int j=0; j<10; j++){ for (int i=0; i<20; i++) { y[i][j] = i + j; }} в результате применения оптимизации может быть преобразован в: for (int i=0; i<20; i++){ for (int j=0; j<10; j++) { y[i][j] = i + j; }} В отдельных случаях, такое преобразование может создать контекст для дальнейших оптимизаций, например для векторизации. В то же время, как и любая другая оптимизация компилятора, данная оптимизация может привести к ухудшению производительности. Рассмотрим следующий пример: for (int i=0; i<10; i++){ for (int j=0; j<20; j++) { a[i] = a[i] + b[j][i] * c[i] }} Применение оптимизации в данном случае может улучшить производительность доступа к b[j][i], однако появятся повторные чтения a[i] и c[i] во внутреннем цикле в течение каждой итерации. В результате, эффективность работы может ухудшиться. (ru)
dbo:thumbnail
dbo:wikiPageID
  • 1837923 (xsd:integer)
dbo:wikiPageLength
  • 4104 (xsd:nonNegativeInteger)
dbo:wikiPageRevisionID
  • 1052687857 (xsd:integer)
dbo:wikiPageWikiLink
dbp:wikiPageUsesTemplate
dcterms:subject
rdf:type
rdfs:comment
  • In compiler theory, loop interchange is the process of exchanging the order of two iteration variables used by a nested loop. The variable used in the inner loop switches to the outer loop, and vice versa. It is often done to ensure that the elements of a multi-dimensional array are accessed in the order in which they are present in memory, improving locality of reference. For example, in the code fragment: for i from 0 to 10 for j from 0 to 20 a[i,j] = i + j loop interchange would result in: for j from 0 to 20 for i from 0 to 10 a[i,j] = i + j (en)
  • Перестановка циклов (англ. Loop interchange) — оптимизация компилятора при которой меняется порядок итерационных переменных, относящихся к группе вложенных циклов. Итерационная переменная, используемая во внутреннем цикле, перемещается во внешний цикл, и наоборот. Это часто делается, чтобы гарантировать, что элементы многомерных массивов доступны в том порядке, в котором они хранятся в памяти, т.е. для улучшения локальности ссылок. Например, следующий код: for (int j=0; j<10; j++){ for (int i=0; i<20; i++) { y[i][j] = i + j; }} в результате применения оптимизации может быть преобразован в: (ru)
rdfs:label
  • Loop interchange (en)
  • Перестановка циклов (ru)
owl:sameAs
prov:wasDerivedFrom
foaf:depiction
foaf:isPrimaryTopicOf
is dbo:wikiPageWikiLink of
is foaf:primaryTopic of
Powered by OpenLink Virtuoso    This material is Open Knowledge     W3C Semantic Web Technology     This material is Open Knowledge    Valid XHTML + RDFa
This content was extracted from Wikipedia and is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License