[LLVMdev] [RFC] "noclone" function attribute

James Molloy James.Molloy at arm.com
Tue Dec 4 09:23:27 PST 2012


Hi all + llvm-commits,

After the discussion below, please find attached my patch to add a new
"noduplicate" function attribute.

I've modified CodeMetrics and LoopInfo, which covers most cases, but
JumpThreading and InlineCost don't use CodeMetrics yet, so they required
changing manually.

Cheers,

James

On Mon, 2012-12-03 at 23:46 +0000, Chris Lattner wrote:
> On Dec 3, 2012, at 9:48 AM, James Molloy <James.Molloy at arm.com> wrote:
>
> > Hi,
> >
> > Thanks for the pointers. My patch now calls the attribute "noduplicate",
> > and updates CodeMetrics to have another field:
> >
> > bool notDuplicatable;
> >
> > Which semantically is "containsIndirectBr || containsNoDuplicateInst". I
> > didn't repurpose containsIndirectBr because I felt what I'm looking for
> > is sufficiently different (indirectbr inhibits inlining, whereas
> > noduplicate does not, if there is one call site).
>
> I'm pretty sure that it's fine to inline indirectbr if there is a single call site and the inlinee is to be deleted.
>
> -Chris
>
>


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: noduplicate.diff
Type: text/x-patch
Size: 22069 bytes
Desc: noduplicate.diff
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121204/932f832d/attachment.bin>


More information about the llvm-dev mailing list