目前metadata只能加到Instruction上。我担心的是compiler对llvm.dbg.declare和llvm.dbg.value有特殊的理解，你牵连一下之后code
generator啥错都没报么？


On Wed, Feb 13, 2013 at 9:13 AM, jl3937 <notifications@github.com> wrote:

> In lib/Analyses/ReductionVerifier.cpp:
>
> > +// to use ReductionVerifier as the underlying AA to generate the call
> > +// graph.
> > +// static RegisterAnalysisGroup<AliasAnalysis> Y(X);
> > +
> > +char ReductionVerifier::ID = 0;
> > +
> > +bool ReductionVerifier::runOnModule(Module &M) {
> > +  Function *DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
> > +  for (Value::use_iterator UI = DeclareFn->use_begin();
> > +       UI != DeclareFn->use_end(); ++UI) {
> > +    User *Usr = *UI;
> > +    assert(isa<CallInst>(Usr) || isa<InvokeInst>(Usr));
> > +    CallSite CS(cast<Instruction>(Usr));
> > +    MDNode *MD = cast<MDNode>(CS.getArgument(0));
> > +    Value *V = MD->getOperand(0);
> > +    errs() << *V << "\n";
>
> 要么牵连llvm.dbg.declare，要么牵连llvm.dbg.value，要么不知道global和argument咋处理。。
> 在参数的Meradata里加些标记行不行？保证不跟本来就有的混淆 在 2013-2-13，8:20，wujingyue <
> notifications@github.com> 写道： In lib/Analyses/ReductionVerifier.cpp:
>  +// to use ReductionVerifier as the underlying AA to generate the call
> +// graph. +// static RegisterAnalysisGroup<AliasAnalysis> Y(X); + +char
> ReductionVerifier::ID = 0; + +bool ReductionVerifier::runOnModule(Module
> &M) { + Function *DeclareFn = Intrinsic::getDeclaration(&M,
> Intrinsic::dbg_declare); + for (Value::use_iterator UI =
> DeclareFn->use_begin(); + UI != DeclareFn->use_end(); ++UI) { + User *Usr =
> *UI; + assert(isa<CallInst>(Usr) || isa<InvokeInst>(Usr)); + CallSite
> CS(cast<Instruction>(Usr)); + MDNode *MD = cast<MDNode>(CS.getArgument(0));
> + Value *V = MD->getOperand(0); + errs() << *V << "\n";
> 这打的什么东西呀？bc里面原来就有的llvm.dbg.declare也被牵连了？ — Reply to this email directly or
> view it on GitHub<
> https://github.com/wujingyue/neongoby/pull/4/files#r2995128>.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/wujingyue/neongoby/pull/4/files#r2995780>.
>
>



-- 
Jingyue Wu
Department of Computer Science
Columbia University
New York, NY 10027
http://www.cs.columbia.edu/~jingyue