<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 Jul 31, 2015, at 1:07 PM, Owen Anderson <<a href="mailto:resistor@mac.com" class="">resistor@mac.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">On Jul 31, 2015, at 1:01 PM, Eric Christopher <<a href="mailto:echristo@gmail.com" class="">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Jul 31, 2015 at 12:40 PM Eric Christopher <<a href="mailto:echristo@gmail.com" class="">echristo@gmail.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="gmail_quote"><div dir="ltr" class="">On Fri, Jul 31, 2015 at 12:22 PM Owen Anderson <<a href="mailto:resistor@mac.com" target="_blank" class="">resistor@mac.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class="" style="word-wrap: break-word;"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jul 31, 2015, at 11:28 AM, Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" target="_blank" class="">mehdi.amini@apple.com</a>> wrote:</div><br class=""><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><blockquote type="cite" class=""><div class=""><br class="">On Jul 31, 2015, at 10:56 AM, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank" class="">echristo@gmail.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div dir="ltr" class=""><br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">On 30 July 2015 at 14:52, Daniel Sanders <<a href="mailto:Daniel.Sanders@imgtec.com" target="_blank" class="">Daniel.Sanders@imgtec.com</a>> wrote:<br class="">> We will need a string serialization of the TargetTuple so that we can store it in the IR and read it back.<br class=""><br class="">Why does it have to be in the IR? If every tool that deals with IR has<br class="">the same options and they mean the same thing I don't see why we'd<br class="">need that.<br class=""><br class=""></blockquote><div class=""><br class=""></div><div class="">I agree with the need for serializing information and options into the module.</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><br class="">> Whether this is in one piece (e.g. 'target tuple = "...") or multiple pieces (e.g. 'target arch = "..."', 'target endian = "..."') doesn't matter too much at first but I can see the benefits of the latter being the end point. If we do choose that multiple pieces then I'd like to pass through the former first to keep the early steps of the migration to a TargetTuple as simple and mechanical as possible.<br class=""><br class="">Assuming we really need it, wouldn't it work if we put in metadata?<br class="">That way, it would bloat the IR of targets that really needed it and<br class="">not the ones that don't, at the same time as being non-critical to<br class="">parsing and validating the IR, so you could safely drop some<br class="">information without breaking the file.<br class=""><br class=""></blockquote><div class=""><br class=""></div><div class="">Metadata won't work. Metadata is defined to not affect code correctness and this obviously does.</div></div></div></div></blockquote><div class=""><br class=""></div><div class=""><br class=""></div></div><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline !important;">Is it true for Module level Metadata and not only for instruction attached one?</span></div></blockquote><br class=""></div></div><div class="" style="word-wrap: break-word;"><div class="">There are examples of module-level metadata that impact the correctness of the generated code in the LangRef today:</div><div class=""><br class=""></div><div class=""><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs_LangRef.html-23module-2Dflags-2Dmetadata&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=aUvqzyTrLOKS-BK3BO7td03IaH6-VO5DXzWD6H5y-OQ&s=au9FpyOhRLd6uqiBp5nru2fYFvu2rtVZPLUXEenEe4o&e=" target="_blank" class="">http://llvm.org/docs/LangRef.html#module-flags-metadata</a></div><div class=""><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs_LangRef.html-23objective-2Dc-2Dgarbage-2Dcollection-2Dmodule-2Dflags-2Dmetadata&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=aUvqzyTrLOKS-BK3BO7td03IaH6-VO5DXzWD6H5y-OQ&s=gt_eBxI3NOk6xUVdhvsDzHlj8MNkTwPKJvU4WL2E0RQ&e=" target="_blank" class="">http://llvm.org/docs/LangRef.html#objective-c-garbage-collection-module-flags-metadata</a></div><div class=""><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs_LangRef.html-23automatic-2Dlinker-2Dflags-2Dmodule-2Dflags-2Dmetadata&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=aUvqzyTrLOKS-BK3BO7td03IaH6-VO5DXzWD6H5y-OQ&s=UanTvBljzEyH-LFJzFax25FC1rLyrxXe2E-pTypkZHk&e=" target="_blank" class="">http://llvm.org/docs/LangRef.html#automatic-linker-flags-module-flags-metadata</a></div><div class=""><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs_LangRef.html-23c-2Dtype-2Dwidth-2Dmodule-2Dflags-2Dmetadata&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=aUvqzyTrLOKS-BK3BO7td03IaH6-VO5DXzWD6H5y-OQ&s=swiY__nZ9xq-w8zuGd8kxKS2NuQXOlkFW0ei5ljtPGc&e=" target="_blank" class="">http://llvm.org/docs/LangRef.html#c-type-width-module-flags-metadata</a></div></div></blockquote><div class=""><br class=""></div></div></div><div dir="ltr" class=""><div class="gmail_quote"><div class="">Wow, those are terrible. I remember the first as it was a hack for dealing with LTO and being unable to specify code generation flags. It definitely was not meant to affect whether or not correct output happened.</div><div class=""><br class=""></div><div class="">The rest appear to be even worse and should not have gone in. I can prepare a patch to remove them if you'd like.</div></div></div></blockquote><div class=""><br class=""></div><div class="">In case it wasn't obvious this is me both being sad, mostly joking, and a little serious about it. I realize that apparently the ship has sailed here, but these should probably be first class IR citizens rather than building off of the "named metadata" extension.</div></div></div></div></blockquote><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">The problem with this direction is that clients need to be able to extend the IR with their own additional annotations according to their own schemas. We cannot practically bake all of those in as first-class IR citizens. </div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">To throw in another example, SPIR 1.2 uses module metadata for required-for-correctness purposes: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.khronos.org_files_opencl-2Dspir-2D12-2Dprovisional.pdf&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=aUvqzyTrLOKS-BK3BO7td03IaH6-VO5DXzWD6H5y-OQ&s=BXloa9G_y5KsWuxoOCeeZ4Wuxuu81bW1u9iQevCvMTA&e=" class="">https://www.khronos.org/files/opencl-spir-12-provisional.pdf</a></div></div></blockquote><br class=""></div><div>As does NVVM: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__docs.nvidia.com_cuda_nvvm-2Dir-2Dspec_index.html-23global-2Dproperty-2Dannotation-2Dchapter-2D11&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=aUvqzyTrLOKS-BK3BO7td03IaH6-VO5DXzWD6H5y-OQ&s=NCAeE4K1ggh1oBJCUMnO0iw6xvMrfe-riVr42RXSF4A&e=" class="">http://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#global-property-annotation-chapter-11</a></div><div><br class=""></div><div>—Owen</div></body></html>