Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Control dependencies  





2 Data dependencies  



2.1  Flow(True) dependence  





2.2  Antidependence  





2.3  Output dependence  





2.4  Input dependence  







3 Loop dependencies  





4 See also  





5 Further reading  














Dependence analysis






Deutsch
فارسی
Српски / srpski
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Incompiler theory, dependence analysis produces execution-order constraints between statements/instructions. Broadly speaking, a statement S2 depends on S1ifS1 must be executed before S2. Broadly, there are two classes of dependencies--control dependencies and data dependencies.

Dependence analysis determines whether it is safe to reorderorparallelize statements.

Control dependencies[edit]

Control dependency is a situation in which a program instruction executes if the previous instruction evaluates in a way that allows its execution.

A statement S2iscontrol dependentonS1 (written ) if and only if S2's execution is conditionally guarded by S1. S2iscontrol dependentonS1 if and only if where is the post dominance frontier of statement . The following is an example of such a control dependence:

S1       if x > 2 goto L1
S2       y := 3   
S3   L1: z := y + 1

Here, S2 only runs if the predicate in S1 is false.

Data dependencies[edit]

A data dependence arises from two statements which access or modify the same resource.

Flow(True) dependence[edit]

A statement S2isflow dependentonS1 (written ) if and only if S1 modifies a resource that S2 reads and S1 precedes S2 in execution. The following is an example of a flow dependence (RAW: Read After Write):

S1       x := 10
S2       y := x + c

Antidependence[edit]

A statement S2isantidependentonS1 (written ) if and only if S2 modifies a resource that S1 reads and S1 precedes S2 in execution. The following is an example of an antidependence (WAR: Write After Read):

S1       x := y + c
S2       y := 10

Here, S2 sets the value of y but S1 reads a prior value of y.

Output dependence[edit]

A statement S2isoutput dependentonS1 (written ) if and only if S1 and S2 modify the same resource and S1 precedes S2 in execution. The following is an example of an output dependence (WAW: Write After Write):

S1       x := 10
S2       x := 20

Here, S2 and S1 both set the variable x.

Input dependence[edit]

A statement S2isinput dependentonS1 (written ) if and only if S1 and S2 read the same resource and S1 precedes S2 in execution. The following is an example of an input dependence (RAR: Read-After-Read):

S1       y := x + 3
S2       z := x + 5

Here, S2 and S1 both access the variable x. This dependence does not prohibit reordering.

Loop dependencies[edit]

The problem of computing dependencies within loops, which is a significant and nontrivial problem, is tackled by loop dependence analysis, which extends the dependence framework given here.

See also[edit]

Further reading[edit]


Retrieved from "https://en.wikipedia.org/w/index.php?title=Dependence_analysis&oldid=1197928018"

Category: 
Static program analysis
 



This page was last edited on 22 January 2024, at 13:04 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki