<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Book Antiqua";
        panose-1:2 4 6 2 5 3 5 3 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.gmailmsg
        {mso-style-name:gmail_msg;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Book Antiqua","serif";
        font-variant:normal !important;
        color:windowtext;
        text-transform:none;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;
        vertical-align:baseline;}
.MsoChpDefault
        {mso-style-type:export-only;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-IE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>Thanks David,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>I have tried ‘</span><span style='font-family:"Courier New";mso-fareast-language:EN-US'>MF.getFunction()->hasFnAttribute(Attribute::???)</span><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>’, but it seems that the front-end ‘</span><span style='font-family:"Courier New";mso-fareast-language:EN-US'>NoInstrumentFunction</span><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>’ attribute is not propagated to the collection of LLVM IR attributes (no equivalent is in the ‘</span><span style='font-family:"Courier New";mso-fareast-language:EN-US'>Attribute::AttrKind</span><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>’ 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.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>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 ‘</span><span style='font-family:"Courier New";mso-fareast-language:EN-US'>Decl</span><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>’ attribute.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>All the best and thanks for the pointer,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'>            MartinO<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Book Antiqua","serif";mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> David Blaikie [mailto:dblaikie@gmail.com] <br><b>Sent:</b> 20 December 2016 16:27<br><b>To:</b> Martin J. O'Riordan; LLVM Developers<br><b>Subject:</b> Re: [llvm-dev] Accessing '__attribute__((noinstrument))' during lowering<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>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.<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Tue, Dec 20, 2016 at 2:04 AM Martin J. O'Riordan via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span class=gmailmsg><span style='font-family:"Book Antiqua","serif";color:black'>Is it possible to find whether a function has the ‘</span></span><span class=gmailmsg><span style='font-family:"Courier New";color:black'>noinstrument</span></span><span class=gmailmsg><span style='font-family:"Book Antiqua","serif";color:black'>’ 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 ‘</span></span><span class=gmailmsg><span style='font-family:"Courier New";color:black'>MachineFunction</span></span><span class=gmailmsg><span style='font-family:"Book Antiqua","serif";color:black'>’ or ‘</span></span><span class=gmailmsg><span style='font-family:"Courier New";color:black'>MachineFunctionInfo</span></span><span class=gmailmsg><span style='font-family:"Book Antiqua","serif";color:black'>’ interfaces.</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span class=gmailmsg><span style='font-family:"Book Antiqua","serif";color:black'> </span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span class=gmailmsg><span style='font-family:"Book Antiqua","serif";color:black'>Thanks,</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span class=gmailmsg><span style='font-family:"Book Antiqua","serif";color:black'> </span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span class=gmailmsg><span style='font-family:"Book Antiqua","serif";color:black'>            MartinO</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span class=gmailmsg><span style='font-family:"Book Antiqua","serif";color:black'> </span></span><o:p></o:p></p></div></div><p class=MsoNormal>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p></blockquote></div></div></body></html>