Attached is a small patch that begins the definition of a new function pass, DependenceGraph, that will build a dependence graph for an entire function. I'm trying to sneak up on the problem in stages, rather than blatting out one big chunk of code, hoping to make it easier to review.<div>
<br></div><div>This new pass depends on the DependenceAnalysis pass to answer questions about the dependence between pairs of instructions. There are two separate passes because there's a useful separation of concerns. A dependence exists if two conditions are met:<div>
<ol><li>Two instructions reference the same memory location, and</li><li>There is a flow of control leading from one instruction to the other.</li></ol><div>DependenceAnalysis attacks the first condition; DependenceGraph attacks the second.</div>
<div><br></div><div>Someday it may be useful to write a different pass, called something like LoopDependenceGraph, that would build a dependence graph for a single loop nest. Such a pass could still rely on the DependenceAnalysis pass.</div>
<div><br></div></div><div>Thanks,</div><div>Preston</div><div><br></div></div>