开发者

def-use chain in llvm

开发者 https://www.devze.com 2023-03-22 08:31 出处:网络
I extract Def_Use chain by following code in LLVM: for (Value::use_iterator i = F->use_begin(), e = F->use_end(); i != e; ++i)

I extract Def_Use chain by following code in LLVM:

for (Value::use_iterator i = F->use_begin(), e = F->use_end(); i != e; ++i)
  if (Instruction *Inst = dyn_cast<Instruction>(*i)) {
    errs() << "F is used in instruction:\n";
    errs() << *Inst << "\n";
  }

Now, I want to distinguish the register name or 开发者_JAVA技巧memory variable that lead to this data dependency.

Thanks


Just determine, which instruction uses your value F and how. E.g. if the Use is load or store instr, then you can check the operand of the instruction to check whether F is used as an address, etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消