Martin J. O'Riordan via llvm-dev
2016-Dec-20 10:04 UTC
[llvm-dev] Accessing '__attribute__((noinstrument))' during lowering
Is it possible to find whether a function has the 'noinstrument' attribute during Target lowering? I would like to check if this is present on a function quite late in the process when I am performing normal Target lowering and Target Frame lowering actions, but I can't find the appropriate query in the 'MachineFunction' or 'MachineFunctionInfo' interfaces. Thanks, MartinO -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161220/40e31129/attachment.html>
David Blaikie via llvm-dev
2016-Dec-20 16:26 UTC
[llvm-dev] Accessing '__attribute__((noinstrument))' during lowering
I imagine you can get the llvm::Function from the MachineFunction, and the attribute will be there (on the llvm::Function), but can't say I know much about it. On Tue, Dec 20, 2016 at 2:04 AM Martin J. O'Riordan via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Is it possible to find whether a function has the ‘noinstrument’ > attribute during Target lowering? I would like to check if this is present > on a function quite late in the process when I am performing normal Target > lowering and Target Frame lowering actions, but I can’t find the > appropriate query in the ‘MachineFunction’ or ‘MachineFunctionInfo’ > interfaces. > > > > Thanks, > > > > MartinO > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161220/d1bf8905/attachment.html>
Martin J. O'Riordan via llvm-dev
2016-Dec-21 09:48 UTC
[llvm-dev] Accessing '__attribute__((noinstrument))' during lowering
Thanks David, I have tried ‘MF.getFunction()->hasFnAttribute(Attribute::???)’, but it seems that the front-end ‘NoInstrumentFunction’ attribute is not propagated to the collection of LLVM IR attributes (no equivalent is in the ‘Attribute::AttrKind’ enum). It is not obvious that there is another mechanism, and I suspect that there is not due to the separation between FE processing and LLVM IR. However, I think that I could add a new IR attribute to the TD file, and set it when emitting IR in the FE depending on the corresponding CLang ‘Decl’ attribute. All the best and thanks for the pointer, MartinO From: David Blaikie [mailto:dblaikie at gmail.com] Sent: 20 December 2016 16:27 To: Martin J. O'Riordan; LLVM Developers Subject: Re: [llvm-dev] Accessing '__attribute__((noinstrument))' during lowering I imagine you can get the llvm::Function from the MachineFunction, and the attribute will be there (on the llvm::Function), but can't say I know much about it. On Tue, Dec 20, 2016 at 2:04 AM Martin J. O'Riordan via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > wrote: Is it possible to find whether a function has the ‘noinstrument’ attribute during Target lowering? I would like to check if this is present on a function quite late in the process when I am performing normal Target lowering and Target Frame lowering actions, but I can’t find the appropriate query in the ‘MachineFunction’ or ‘MachineFunctionInfo’ interfaces. Thanks, MartinO _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161221/b316c9b5/attachment.html>