Hi, For a certain type of analysis I generate inline assembly which I insert into the LLVM IR code. This inline assembly code contains labels that should not be duplicated. Problem is that the tail duplication pass duplicates code. It checks isNotDuplicatable on a machine instruction however there is no such a flag on an IR instruction that I could set. Is there a way to tell in an IR pass that code should not be duplicated? Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140717/7cda73d0/attachment.html>
On Jul 17, 2014, at 8:41 AM, Jan Hoogerbrugge <jan.hoogerbrugge at gmail.com> wrote:> Hi, > > For a certain type of analysis I generate inline assembly which I insert into the LLVM IR code. This > inline assembly code contains labels that should not be duplicated. Problem is that the tail > duplication pass duplicates code. It checks isNotDuplicatable on a machine instruction however > there is no such a flag on an IR instruction that I could set. Is there a way to tell in an IR pass > that code should not be duplicated? > > JanThere is the noduplicate attribute you can place on the function definition / the asm call site which should work -Matt
Hi Matt, Thanks for the answer. Unfortunately it does not seem to work. Putting the NoDuplicate on the CallInst of an inline assembly gives the message: Attribute 'noduplicate' only applies to functions! Putting the NoDuplicate on the function in which the inline assembly resides has not effect. Also adding the MinSize or OptimizeForSize attribute does not stop tail duplication. Another suggestion? Regards, Jan. On Thu, Jul 17, 2014 at 6:33 PM, Matt Arsenault <arsenm2 at gmail.com> wrote:> > On Jul 17, 2014, at 8:41 AM, Jan Hoogerbrugge <jan.hoogerbrugge at gmail.com> > wrote: > > > Hi, > > > > For a certain type of analysis I generate inline assembly which I insert > into the LLVM IR code. This > > inline assembly code contains labels that should not be duplicated. > Problem is that the tail > > duplication pass duplicates code. It checks isNotDuplicatable on a > machine instruction however > > there is no such a flag on an IR instruction that I could set. Is there > a way to tell in an IR pass > > that code should not be duplicated? > > > > Jan > > There is the noduplicate attribute you can place on the function > definition / the asm call site which should work > > -Matt-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140717/d491740f/attachment.html>
Is this volatile inline asm? If so, I don't think we should duplicate it. If we do, that might be a bug. On Thu, Jul 17, 2014 at 8:41 AM, Jan Hoogerbrugge < jan.hoogerbrugge at gmail.com> wrote:> Hi, > > For a certain type of analysis I generate inline assembly which I insert > into the LLVM IR code. This > inline assembly code contains labels that should not be duplicated. > Problem is that the tail > duplication pass duplicates code. It checks isNotDuplicatable on a machine > instruction however > there is no such a flag on an IR instruction that I could set. Is there a > way to tell in an IR pass > that code should not be duplicated? > > Jan > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140717/0220c8cf/attachment.html>
Possibly Parallel Threads
- [LLVMdev] Generate code for ARM Cortex m0, m3, and m4.
- RFC: Removal of noduplicate attribute
- [LLVMdev] Should we add noduplicate attribute on the function which contains a noduplicate function call?
- RFC: Removal of noduplicate attribute
- [LLVMdev] [RFC] "noclone" function attribute