Hello, I have a question that I would appreciate if you could answer.
I would like to know if there is an API in LLVM that allows me to search for other instructions that depend on an instruction. For example, I would like to know what instruction uses the result loaded by a LOAD instruction. We assume the following IR.
%16 = load i16, i16* %14, align 2, !tbaa !4
%17 = add nuw nsw i64 %16, 1
%18 = mul i16, %17, %16
I want to do like the following.
Instruction* LoadInstruction = ~~ // %16
std::vector<Instruction*> DI = Function(LoadInstruction); // DI = [%17, %18]
What LLVM API should I use to do something like Function() above? Or do I have to implement it by myself?