[LLVMdev] Anderson's analysis, getresult instruction on x86_64

Daniel Berlin dberlin at dberlin.org
Tue Aug 5 23:11:58 PDT 2008


On Tue, Aug 5, 2008 at 2:02 PM, Prakash Prabhu <prakash.prabhu at gmail.com> wrote:
> Thanks for the replies, Daniel and Matthijs. I added some code to generate
> the copy constraint, which I think (in the present form) is wrong (or at
> best not field sensitive):
>

This andersen's implementation is not field sensitive anyway.
I

> +void Andersens::visitGetResultInst(GetResultInst &GR) {
> +       if (isa<PointerType>(GR.getType()))
> +       {
> +               // P1 = getresult P2 --> <Copy/P1/P2>
> +               Constraints.push_back(Constraint(Constraint::Copy,
> getNodeValue(GR),
> +
> getNode(GR.getOperand(0))));
> +       }
> +}
>
> Take for example the getresult statement:
>
> %mrv_gr = getresult { i64*, i64* } %74, 0 ; ; <i64*> [#uses=1]
>
> The above code would add the constraint as Copy/%mrv_gr/%74 instead of
> Copy/%mrv_gr/%74.0 (the actual field which is a pointer). Is there a way in
> which
> one can extract the Value* of the appropriate field of getresult using the
> index (0 in this case) and the base structure (%74) ? (or is this what you
> were refering to: "For aggregates in memory, the pointer to the part of the
> aggregate can simply be used, but no such thing for first class values.",
> Matthjis ?)
>

There is a lot more work than this involved in supporting field
sensitive analysis in andersen's.in llvm.
Last time i chatted with Ben Hardekopf, he had a prototype for it.



More information about the llvm-dev mailing list