[LLVMdev] Control dependence pass

John Criswell criswell at uiuc.edu
Fri Oct 30 11:32:05 PDT 2009


funceval wrote:
> Hi,
>
> I have written a pass to find the control dependences. Right now I am
> using a map of of basic blocks to vectors of basic blocks to store the
> dependences, so the dependence is represented in terms of basic
> blocks. Before I submit the patch for review, I wanted to know the
> format in which control dependences should be stored.
>
> 1) Should the dependence information be instead represented in terms
> of instructions? This is how I plan to do in terms of instructions -
> if basic block bb1 is control dependent on basic block bb2, then all
> instructions in bb1 are dependent on the compare instruction in bb2.
>   
I think your pass can store the dependence information however it wants.
> 2) Shall I provide an additional wrapper class to get the dependence
> information in terms of instructions?
>   
Why not add methods to your current class to look up control dependence 
information using an Instruction?  I don't see any reason why your pass 
can't accept both Instructions and BasicBlocks for lookup operations.
 
> 3) Is the STL map good enough for storing and retrieving the
> dependence information?
>   
I don't know.  Have you read about the data structures in the LLVM 
Programmer's Manual?

-- John T.

> Thanks
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>   




More information about the llvm-dev mailing list