<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 24, 2015, at 11:16 AM, Akira Hatanaka <<a href="mailto:ahatanak@gmail.com" class="">ahatanak@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Any thoughts?<br class=""></div></div></blockquote><div><br class=""></div>This looks promising. It seems like it ought to address at least some of Chandler’s concerns with your previous patch. I’d like to see what the patch looks like for handling target-specific attributes.</div><div><br class=""></div><div>Chandler, are you OK with the general direction of this?</div><div><br class=""></div><div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Mar 13, 2015 at 5:36 PM, Duncan P. N. Exon Smith <span dir="ltr" class=""><<a href="mailto:dexonsmith@apple.com" target="_blank" class="">dexonsmith@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> On 2015-Mar-10, at 14:59, Akira Hatanaka <<a href="mailto:ahatanak@gmail.com" class="">ahatanak@gmail.com</a>> wrote:<br class="">
><br class="">
> I came up with a patch that addresses the concerns Chandler brought up. This is still a WIP patch, so I would like to hear feedback before I go too far down this route.<br class="">
><br class="">
> The updated patch takes a completely different approach to determining a function's inlinability. It uses table-gen to specify the attributes' enums along with their inlinability/compatibility information. With this new approach, whenever someone defines and uses a new attribute in the IR, the compatibility information has to be added too. Currently, there is only one field in class Attr in the .td file, which indicates whether the inliner should check the attribute's compatibility, but it should be easy to add other fields or rules if other passes need more information about the attribute. For example, I think most of the code in the verifier that looks at attributes in the IR can be auto-generated by table-gen.<br class="">
><br class="">
> The patch doesn't add any checks for the target-specific function attribute strings, but it can be done in a similar way to target-independent enum attributes. Functions are auto-generated by table-gen from .td files and are passed to the constructor of TargetIRAnalysis to enable checking compatibility of target-specific attributes. Also, we should be able to generate code that checks the validity of a string attribute added to the IR, which is something we currently lack. It would issue a warning or error if a string not recognized by the target was used to get an attribute from the attribute set.<br class="">
><br class="">
<br class="">
</span>This direction SGTM. @Chandler, does this look better to you?<br class="">
<div class=""><div class="h5"><br class="">
><br class="">
> <a href="http://reviews.llvm.org/D7802" target="_blank" class="">http://reviews.llvm.org/D7802</a><br class="">
><br class="">
> Files:<br class="">
> include/llvm/Analysis/InlineCost.h<br class="">
> include/llvm/Analysis/TargetTransformInfo.h<br class="">
> include/llvm/IR/Attributes.h<br class="">
> include/llvm/IR/EnumAttributes.td<br class="">
> lib/Analysis/IPA/InlineCost.cpp<br class="">
> lib/Analysis/TargetTransformInfo.cpp<br class="">
> lib/CodeGen/LLVMTargetMachine.cpp<br class="">
> lib/IR/Attributes.cpp<br class="">
> lib/IR/Makefile<br class="">
> lib/Target/AArch64/AArch64TargetMachine.cpp<br class="">
> lib/Target/ARM/ARMTargetMachine.cpp<br class="">
> lib/Target/Mips/MipsTargetMachine.cpp<br class="">
> lib/Target/NVPTX/NVPTXTargetMachine.cpp<br class="">
> lib/Target/PowerPC/PPCTargetMachine.cpp<br class="">
> lib/Target/R600/AMDGPUTargetMachine.cpp<br class="">
> lib/Target/TargetMachine.cpp<br class="">
> lib/Target/X86/X86TargetMachine.cpp<br class="">
> lib/Target/XCore/XCoreTargetMachine.cpp<br class="">
> utils/TableGen/Attribute.cpp<br class="">
> utils/TableGen/TableGen.cpp<br class="">
> utils/TableGen/TableGenBackends.h<br class="">
><br class="">
> EMAIL PREFERENCES<br class="">
> <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank" class="">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br class="">
</div></div>> <D7802.21626.patch><br class="">
<br class="">
</blockquote></div><br class=""></div></div>
_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@cs.uiuc.edu" class="">llvm-commits@cs.uiuc.edu</a><br class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br class=""></div></blockquote></div><br class=""></body></html>