Rematerialization
   HOME





Rematerialization
In computer science, rematerialization or remat is a compiler optimization which saves time by recomputing a value instead of loading it from memory. It is typically tightly integrated with register allocation, where it is used as an alternative to register spilling, spilling registers to memory. It was conceived by Gregory Chaitin, Marc Auslander, Ashok Chandra, John Cocke (computer scientist), John Cocke, Martin Hopkins and Peter Markstein and implemented in the Pl.8 compiler for the 801 Minicomputer in the late 1970s. Later improvements were made by Preston Briggs, Keith D. Cooper, and Linda Torczon in 1992. Traditional optimizations such as common subexpression elimination and loop invariant hoisting often focus on eliminating redundant computation. Since computation requires CPU cycles, this is usually a good thing, but it has the potentially devastating side effect that it can increase the live ranges of variables and create many new variables, resulting in spills during re ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Loop Invariant Hoisting
In computer programming, loop-invariant code consists of statements or expressions (in an imperative programming, imperative programming language) that can be moved outside the body of a loop without affecting the semantics of the program. Loop-invariant code motion (also called hoisting or scalar promotion) is a compiler optimization that performs this movement automatically. Example In the following code sample, two optimizations can be applied. int i = 0; while (i < n) Although the calculation x = y + z and x * x is loop-invariant, precautions must be taken before moving the code outside the loop. It is possible that the loop condition is false (for example, if n holds a negative value), and in such case, the loop body should not be executed at all. One way of guaranteeing correct behaviour is using a conditional branch outside of the loop. Evaluating the loop condition can have Side effect (computer sci ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Computer Science
Computer science is the study of computation, information, and automation. Computer science spans Theoretical computer science, theoretical disciplines (such as algorithms, theory of computation, and information theory) to Applied science, applied disciplines (including the design and implementation of Computer architecture, hardware and Software engineering, software). Algorithms and data structures are central to computer science. The theory of computation concerns abstract models of computation and general classes of computational problem, problems that can be solved using them. The fields of cryptography and computer security involve studying the means for secure communication and preventing security vulnerabilities. Computer graphics (computer science), Computer graphics and computational geometry address the generation of images. Programming language theory considers different ways to describe computational processes, and database theory concerns the management of re ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Preston Briggs
Preston or Prestons may refer to: Places Australia *Preston, Victoria ** City of Preston (Victoria) **Electoral district of Preston **Preston railway station, Melbourne * Preston, Queensland, Toowoomba and Lockyer Valley regions * Preston, Queensland (Whitsunday Region) * Preston, Tasmania * South Preston, Tasmania *Prestons, New South Wales Canada *Preston, Nova Scotia **East Preston, Nova Scotia **North Preston **Preston (electoral district) *Preston, Ontario Cuba *Guatemala, Cuba, also known as Preston, in the Holguín Province England *Preston, Lancashire, city in Lancashire **The City of Preston, Lancashire, a borough and non-metropolitan district **County Borough of Preston, a local government district containing the settlement from 1835 to 1974 **Preston (UK Parliament constituency) **Preston railway station in Preston, Lancashire **The PR postcode area, also known as the Preston postcode area **Preston Urban Area, the conurbation with Preston at its core *Preston, D ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Side Effect (computer Science)
In computer science, an operation, function or expression is said to have a side effect if it has any observable effect other than its primary effect of reading the value of its arguments and returning a value to the invoker of the operation. Example side effects include modifying a non-local variable, a static local variable or a mutable argument passed by reference; raising errors or exceptions; performing I/O; or calling other functions with side-effects. In the presence of side effects, a program's behaviour may depend on history; that is, the order of evaluation matters. Understanding and debugging a function with side effects requires knowledge about the context and its possible histories. Side effects play an important role in the design and analysis of programming languages. The degree to which side effects are used depends on the programming paradigm. For example, imperative programming is commonly used to produce side effects, to update a system's state. By contrast ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  




Available Expression
In the field of compiler optimizations, available expressions is an analysis algorithm that determines for each point in the program the set of expressions that need not be recomputed. Those expressions are said to be ''available'' at such a point. To be available on a program point, the operands of the expression should not be modified on any path from the occurrence of that expression to the program point. The analysis is an example of a forward data flow analysis problem. A set of available expressions is maintained. Each statement is analysed to see whether it changes the operands of one or more available expressions. This yields sets of available expressions at the end of each basic block In compiler construction, a basic block is a straight-line code sequence with no branches in except to the entry and no branches out except at the exit. This restricted form makes a basic block highly amenable to analysis. Compilers usually decom ..., known as the outset in data flow anal ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


picture info

Register Pressure
In computer science, an instruction set architecture (ISA) is an abstract model that generally defines how software controls the CPU in a computer or a family of computers. A device or program that executes instructions described by that ISA, such as a central processing unit (CPU), is called an ''implementation'' of that ISA. In general, an ISA defines the supported instructions, data types, registers, the hardware support for managing main memory, fundamental features (such as the memory consistency, addressing modes, virtual memory), and the input/output model of implementations of the ISA. An ISA specifies the behavior of machine code running on implementations of that ISA in a fashion that does not depend on the characteristics of that implementation, providing binary compatibility between implementations. This enables multiple implementations of an ISA that differ in characteristics such as performance, physical size, and monetary cost (among other things), but that ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Common Subexpression Elimination
In compiler theory, common subexpression elimination (CSE) is a compiler optimization that searches for instances of identical expressions (i.e., they all evaluate to the same value), and analyzes whether it is worthwhile replacing them with a single variable holding the computed value. Example In the following code: a = b * c + g; d = b * c * e; it may be worth transforming the code to: tmp = b * c; a = tmp + g; d = tmp * e; if the cost of storing and retrieving tmp is less than the cost of calculating b * c an extra time. Principle The possibility to perform CSE is based on available expression analysis (a data flow analysis). An expression b*c is available at a point ''p'' in a program if: * every path from the initial node to p evaluates b*c before reaching ''p'', * and there are no assignments to b or c after the evaluation but before ''p''. The cost/benefit analysis performed by an optimizer will calculate whether the cost of the store to tmp is less than the ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Linda Torczon
Linda is an English feminine given name, derived from the Spanish word , meaning "pretty." Linda may also refer to: Names * Linda (given name), a female given name (including a list of people and fictional characters so named) * Linda (singer) (born 1977), stage name of Svetlana Geiman, a Russian singer * Miss Linda, long-time manager and wife of Welsh wrestler Adrian Street Surname * Anita Linda (born Alice Lake, 1924–2020), Filipino film actress * Bogusław Linda (born 1952), Polish actor * La Prieta Linda (1933–2021), Mexican singer and actress * Sarah Linda (born 1987), British actress and model * Solomon Linda (1909–1962), South African Zulu musician, singer and composer who wrote the song "Mbube" which later became "The Lion Sleeps Tonight" Places * Linda, Tasmania, Australia, a ghost town * Linda Valley, Tasmania * Linda, Georgia, a village in Abkhazia * Linda, Bashkortostan, Russia, a village * Linda, California, United States, a census-designated place * ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Keith D
Keith may refer to: People and fictional characters * Keith (given name), includes a list of people and fictional characters * Keith (surname) * Keith (singer), American singer James Keefer (born 1949) * Keith (gamer), American professional League of Legends player * Baron Keith, a line of Scottish barons in the late 18th century * Clan Keith, a Scottish clan associated with lands in northeastern and northwestern Scotland Places Australia * Keith, South Australia, a town and locality Scotland * Keith, Moray, a town ** Keith railway station * Keith Marischal, East Lothian United States * Keith, Georgia, an unincorporated community * Keith, Ohio, an unincorporated community * Keith, West Virginia, an unincorporated community * Keith, Wisconsin, a ghost town * Keith County, Nebraska Other uses * Keith F.C., a football team based in Keith, Scotland * , a ship of the British Royal Navy * Hurricane Keith, a 2000 hurricane that caused extensive damage in Central America * ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  




Peter Markstein
Peter may refer to: People * List of people named Peter, a list of people and fictional characters with the given name * Peter (given name) ** Saint Peter (died 60s), apostle of Jesus, leader of the early Christian Church * Peter (surname), a surname (including a list of people with the name) Culture * Peter (actor) (born 1952), stage name Shinnosuke Ikehata, a Japanese dancer and actor * ''Peter'' (1934 film), a film directed by Henry Koster * ''Peter'' (2021 film), a Marathi language film * "Peter" (''Fringe'' episode), an episode of the television series ''Fringe'' * ''Peter'' (novel), a 1908 book by Francis Hopkinson Smith * "Peter" (short story), an 1892 short story by Willa Cather * ''Peter'' (album), a 1972 album by Peter Yarrow * ''Peter'', a 1993 EP by Canadian band Eric's Trip * "Peter", 2024 song by Taylor Swift from '' The Tortured Poets Department: The Anthology'' Animals * Peter (Lord's cat), cat at Lord's Cricket Ground in London * Peter (chief mouser), Ch ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Compiler Optimization
An optimizing compiler is a compiler designed to generate code that is optimized in aspects such as minimizing program execution time, memory usage, storage size, and power consumption. Optimization is generally implemented as a sequence of optimizing transformations, a.k.a. compiler optimizations algorithms that transform code to produce semantically equivalent code optimized for some aspect. Optimization is limited by a number of factors. Theoretical analysis indicates that some optimization problems are NP-complete, or even undecidable. Also, producing perfectly ''optimal'' code is not possible since optimizing for one aspect often degrades performance for another. Optimization is a collection of heuristic methods for improving resource usage in typical programs. Categorization Local vs. global scope Scope describes how much of the input code is considered to apply optimizations. Local scope optimizations use information local to a basic block. Since basic blocks cont ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]  


Martin Hopkins
Martin may refer to: Places Antarctica * Martin Peninsula, Marie Byrd Land * Port Martin, Adelie Land * Point Martin, South Orkney Islands Europe * Martin, Croatia, a village * Martin, Slovakia, a city * Martín del Río, Aragón, Spain * Martín River, a tributary of the Ebro river in Spain * Martin (Val Poschiavo), Switzerland England * Martin, Hampshire * Martin, Kent * Martin, East Lindsey, Lincolnshire, a hamlet and former parish * Martin, North Kesteven, Lincolnshire, a village and parish * Martin Hussingtree, Worcestershire * Martin Mere, a lake in Lancashire ** WWT Martin Mere, a wetland nature reserve that includes the lake and surrounding areas North America Canada * Rural Municipality of Martin No. 122, Saskatchewan, Canada * Martin Islands, Nunavut, Canada United States * Martin, Florida * Martin, Georgia * Martin, Indiana * Martin, Kentucky * Martin, Louisiana * Martin, Michigan * Martin, Nebraska * Martin, North Dakota * Martin, Ohio * Martin, South Caroli ...
[...More Info...]      
[...Related Items...]     OR:     [Wikipedia]   [Google]   [Baidu]