result of load Instruction

Hi all,

How can i find the instruction that uses the result of a load instruction. For example:

%16 = load i32, i32* %ptr  

%add = add i32 4, %16

In this case, i would like to get the add instruction.

Best,

Mo

Walk the uses of the load instruction: http://llvm.org/docs/doxygen/html/classllvm_1_1Value.html#ac27deb3d41124ec9e679d39021405005

Hi,

If you have access to the LoadInst, you can iterate over LI->uses().

See: http://llvm.org/docs/doxygen/html/classllvm_1_1Value.html

best,
vedant

Isn't this one actually LI->users()?

Tim.

Oof, yep.