Presentation is loading. Please wait.

Presentation is loading. Please wait.

Common Subexpression Elimination and Copy Propagation in Titanium

Similar presentations


Presentation on theme: "Common Subexpression Elimination and Copy Propagation in Titanium"— Presentation transcript:

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

2

3

4

5

6

7 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?)

8 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;

9

10

11

12

13

14

15

16

17

18

19 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

20

21

22

23 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?


Download ppt "Common Subexpression Elimination and Copy Propagation in Titanium"

Similar presentations


Ads by Google