[cfe-commits] [PATCH] llvm.annotation support
jlerouge at apple.com
Wed Jun 22 00:33:50 PDT 2011
On Wed, Jun 22, 2011 at 12:19:41AM -0700, John McCall wrote:
> > On Fri, Jun 17, 2011 at 04:57:22PM -0700, John McCall wrote:
> >> On Jun 14, 2011, at 12:14 AM, Julien Lerouge wrote:
> >> + assert(D->hasAttr<AnnotateAttr>() && "no annotate attribute");
> >> + for (ann_iterator ai = ann_begin(D), ae = ann_end(D); ai != ae; ++ai)
> >> + EmitAnnotationCall(CGM.getIntrinsic(llvm::Intrinsic::var_annotation),
> >> + Builder.CreateBitCast(V, CGM.Int8PtrTy, V->getName()),
> >> Hoist this bitcast out of the loop, please.
> > I'd rather keep this here for now, to keep the IR consistent with
> > what llvm-gcc was doing. The reason is that those annotations are meant
> > to be consumed by a mid level optimization pass, so I don't want to
> > break any existing code that might expect those casts (I know we have
> > such code around here unfortunately).
> > I can add a FIXME, and I'll get back to it once my project has finished
> > the transition to clang. Would that be acceptable ?
> A FIXME would be fine, or any sort of comment that makes it clear that
> having the redundant bitcasts is intentional. Although, unless you run your
> optimization passes before GVN, I don't know how you expect them to
> survive anyway.
Yes, we process those annotations before running any optimization pass
like GVN, but we'd like to move away from that at some point.
PGP Key Id: 0xB1964A62
PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62
PGP Public Key from: keyserver.pgp.com
More information about the cfe-commits