1 / 23

Common Subexpression Elimination and Copy Propagation in Titanium

Common Subexpression Elimination and Copy Propagation in Titanium. Johnathon Jamison David Marin CS265 S. Graham. Global Copy Propagation. Given a = b; … x = a + 1; We want to replace a with b on the last line, but we need to know that a and b are unchanged

brinly
Download Presentation

Common Subexpression Elimination and Copy Propagation in Titanium

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Common Subexpression Elimination and Copy Propagation in Titanium Johnathon Jamison David Marin CS265 S. Graham

  2. Global Copy Propagation • Given a = b; … x = a + 1; • We want to replace a with b on the last line, but we need to know that a and b are unchanged • Def/use analysis isn’t quite enough (why?)

  3. Inserting Fake Defs and Uses • Add fake defs and uses so that def/use analysis gives us the info we need b = b; a = b; … newtemp = b; x = a + 1; • We can use this technique to enable CSE too.

  4. Interaction with Copy Propagation • Any temps introduced are placed after the calculation, so that copy propagation can remove them a = f * i a = f * i temp_1 = a … … b = f * i b = temp_1 temp_2 = b … … c = f * i c = temp_2

  5. Local CSE • Used Muchnick’s algorithm (described in class) • Used defs to find what was killed • Fully implemented • Except method calls • Since we are using defs already, why not so something more substantial?

More Related