[LLVMdev] Instruction->mayReadFromMemory

Seiden Tiger st at iss.tu-darmstadt.de
Fri May 12 12:56:29 PDT 2006

Hi Chris and list

Thanks for your quick answer :-).

Am Freitag, 12. Mai 2006 19:09 schrieb Chris Lattner:
> On Fri, 12 May 2006, Silken Tiger wrote:
> > To find the first instructions which are not depending on others results.
> > So far it seems to be working but i am missing instructions like:
> > %tmp.1 = seteq int %argc, 2             ; <bool> [#uses=1]
> > There seems only an function like llvm::Instruction::mayWriteToMemory
> > but nothing like llvm::Instruction::mayReadFromMemory or s.t. with
> > similiar functionality?
> >
> > Or else: if there is an even easier way to get the non data depending
> > instruction from a block i missed, i would be also happy.
> I'm not sure what you're looking for.
Ok, i'll try to put it in different words: I am looking for the points where 
data is flowing into the basic blocks (and later where data is going out). So 
essentially i want to extract the dataflow out of the llvm internal 

As Example i have the first block in a function:
int %main(int %argc, sbyte** %argv) {
        %tmp.1 = seteq int %argc, 2             ; <bool> [#uses=1]
        br bool %tmp.1, label %then, label %no_exit

At first i thought that %argc must be a memory access. But its a function 
argument, so it is a register value. But looking locally at my block "entry" 
i have currently no idea that %argc is a function argument an thus data 
beeing readily available for usage. So i am looking at an way to find all the 
variables which already contain valid data at the beginning, contrary to data 
which is computed in the block.

Thank you

More information about the llvm-dev mailing list