Copy propagation optimization

rajeshkannanb@aol.in
Thu, 06 Aug 2009 02:45:23 -0400

          From comp.compilers

Related articles
Copy propagation optimization rajeshkannanb@aol.in (2009-08-06)
Re: Copy propagation optimization thisisgiri@gmail.com (Giridhar S) (2009-08-06)
Re: Copy propagation optimization news@iecc.com (2009-08-07)
Re: Copy propagation optimization pronesto@gmail.com (Fernando) (2009-08-07)
Re: Copy propagation optimization kamalpr@gmail.com (kamal) (2009-08-25)
| List of all articles for this month |
From: rajeshkannanb@aol.in
Newsgroups: comp.compilers
Date: Thu, 06 Aug 2009 02:45:23 -0400
Organization: Compilers Central
Keywords: optimize, question
Posted-Date: 06 Aug 2009 14:01:58 EDT

Dear all,


Please clarify my doubt regarding copy propagation optimization.


(snip)


gsiVarA = gsiVarB + gsiVarC;


gsiVarB = 1 ; // One of expression's operand
is
redefined


gsiVarD = gsiVarA ; // Statement-B


(snip end)


As shown in the above snip, can the compiler use the result of
expression
(gsiVarB + gsiVarC) in Statement B instead of gsiVarA.


I expect the below result


(snip)


gsiVarA = gsiVarB + gsiVarC;


load R1, gsiVarB
load R2, gsiVarC
Add R1, R2
Store R1, R3


.... // gsiVarB is redefined.
....


gsiVarD = gsiVarA ; // Statement-B


Store R1, gsiVarD // Result of expression is used.


(snip end)


Please clarify whether the compiler can perform the above optimization.


Thanks and regards,
Kannan


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.