<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><base href="x-msg://2080/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 9, 2012, at 11:43 AM, Villmow, Micah wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div class="WordSection1" style="page: WordSection1; "><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div style="border-style: none none none solid; padding: 0in 0in 0in 4pt; position: static; z-index: auto; "><div><div style="border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-top-style: solid; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding-top: 3pt; padding-right: 0in; padding-bottom: 0in; padding-left: 0in; "><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; ">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; "><span class="Apple-converted-space"> </span>Tanya Lattner [mailto:lattner@<a href="http://apple.com">apple.com</a>]<span class="Apple-converted-space"> </span><br><b>Sent:</b><span class="Apple-converted-space"> </span>Tuesday, October 09, 2012 11:30 AM<br><b>To:</b><span class="Apple-converted-space"> </span>Villmow, Micah<br><b>Cc:</b><span class="Apple-converted-space"> </span>Benyei, Guy;<span class="Apple-converted-space"> </span><a href="mailto:cfe-dev@cs.uiuc.edu" style="color: blue; text-decoration: underline; ">cfe-dev@cs.uiuc.edu</a>;<span class="Apple-converted-space"> </span><a href="mailto:Anton.Lokhmotov@arm.com" style="color: blue; text-decoration: underline; ">Anton.Lokhmotov@arm.com</a><br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [cfe-dev] OpenCL & SPIR specific types - proposal and patch<o:p></o:p></span></div></div></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><o:p> </o:p></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><o:p> </o:p></div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">On Oct 4, 2012, at 1:14 PM, "Villmow, Micah" <<a href="mailto:Micah.Villmow@amd.com" style="color: blue; text-decoration: underline; ">Micah.Villmow@amd.com</a>> wrote:<o:p></o:p></div></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><br><br><o:p></o:p></div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">There needs to be a way to differentiate between an integer and a sampler by only looking at the type. The sampler itself is an opaque type in OpenCL. The only requirement is that it is initialized with a 32bit unsigned integer, not that the type itself is an integer.</span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></div></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><o:p> </o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">I understand that the spec doesn't require it to be a 32 bit integer, but if you are only ever assigning it a 32 bit integer, it doesn't make any sense to have the extra inttoptr instruction. <o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><o:p> </o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">Secondly, your idea of differentiating an integer and sampler by type alone is then based upon the name of the type that you are pointing to and not actually the type itself. Anything based upon names can be risky. There was a point in time where the linker was not properly merging structures that were identical and therefore renaming them. It makes much more sense to attach metadata to samplers and images to denote what is what.<o:p></o:p></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">[Villmow, Micah] Metadata isn’t possible because you can’t attach metadata to arguments.<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Take these functions:<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Kernel void foo(sampler_t a, int b)<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">{<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">}<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Kernel void foo(int a, int b)<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">{<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">}<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">In LLVMIR with sampler as i32, they are both the same function, but they are fundamentally different and have to be handled differently(not only at the compiler level, but also at the runtime level). On a 32bit system, on the runtime side, the size of a sampler_t object is 4 bytes, on a 64bit system it is 8 bytes, but as an i32, its always 4 bytes.<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></i></b></div></div></div></div></div></div></span></blockquote><div><br></div><div>We have a way to attach metadata to arguments right now for kernel arg info. So its not impossible. Our implementation attaches sampler metadata to kernel args and therefore the backends can do the right thing.</div><div><br></div><div>What does the compiler need to do in regards to differentiating each function at the Clang level? I'm not talking about targets, but just the frontend.</div><div><br></div><div>If the spec says its initialized with a 32 bit value, then why does it matter if its fixed to i32? </div><div><br></div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div class="WordSection1" style="page: WordSection1; "><div style="border-style: none none none solid; padding: 0in 0in 0in 4pt; position: static; z-index: auto; "><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Another problem is this case:<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Module 1:<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">int foo(sampler_t a, int b)<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">{<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Return 0;<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">}<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Module 2:<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">int foo(int a, int b)<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">{<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Return 0;<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">}<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Module 3:<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Kernel void bar(global int* a, sampler_t b)<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">{<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">*a = foo(b, *a);<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">}<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Linking Module 1 and 3 together is fine, linking module 2 and 3 together should produce a linker error. If a sampler is an i32, they both are accepted since they have the same signature.<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></i></b></div></div></div></div></span></blockquote><div><br></div><div>You have the exact same problem with opaque types. The linker will assume they are the same unless it can prove otherwise.</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div class="WordSection1" style="page: WordSection1; "><div style="border-style: none none none solid; padding: 0in 0in 0in 4pt; position: static; z-index: auto; "><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">I agree that the opaque pointer with a specific name isn’t the best solution, but unless we add these as fundamental LLVM types, I don’t know of a better way to handle this. I however think relying on metadata for information that is required for correctness is wrong(metadata should not affect correctness) and differentiating if an i32 is a sampler or not based on its use is not the right approach either.<o:p></o:p></span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></i></b></div></div></div></div></span></blockquote><div><br></div><div>Relying on names for correctness is exactly the same as relying on metadata for correctness. How can you guarantee it will never be changed?</div><div><br></div><div>I actually believe that all of these special types should have some metadata attached to them to denote whats what.</div><div><br></div><div>-Tanya</div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div class="WordSection1" style="page: WordSection1; "><div style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-width: initial; border-color: initial; border-left-style: solid; border-left-color: blue; border-left-width: 1.5pt; padding-top: 0in; padding-right: 0in; padding-bottom: 0in; padding-left: 4pt; position: static; z-index: auto; "><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><i><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></i></b></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">The image types being pointers I am fine with as there isn't any other way to do those.<o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><o:p> </o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">-Tanya<o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><o:p> </o:p></div></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><br><br><o:p></o:p></div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">Micah</span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></div></div><div style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-width: initial; border-color: initial; border-left-style: solid; border-left-color: blue; border-left-width: 1.5pt; padding-top: 0in; padding-right: 0in; padding-bottom: 0in; padding-left: 4pt; "><div><div style="border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-top-style: solid; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding-top: 3pt; padding-right: 0in; padding-bottom: 0in; padding-left: 0in; "><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; ">From:</span></b><span class="apple-converted-space"><span style="font-size: 10pt; font-family: Tahoma, sans-serif; "> </span></span><span style="font-size: 10pt; font-family: Tahoma, sans-serif; ">Tanya Lattner [mailto:lattner@<a href="http://apple.com" style="color: blue; text-decoration: underline; "><span style="color: purple; ">apple.com</span></a>]<span class="apple-converted-space"> </span><br><b>Sent:</b><span class="apple-converted-space"> </span>Thursday, October 04, 2012 11:49 AM<br><b>To:</b><span class="apple-converted-space"> </span>Benyei, Guy<br><b>Cc:</b><span class="apple-converted-space"> </span><a href="mailto:cfe-dev@cs.uiuc.edu" style="color: blue; text-decoration: underline; "><span style="color: purple; ">cfe-dev@cs.uiuc.edu</span></a>; Villmow, Micah;<span class="apple-converted-space"> </span><a href="mailto:Anton.Lokhmotov@arm.com" style="color: blue; text-decoration: underline; "><span style="color: purple; ">Anton.Lokhmotov@arm.com</span></a><br><b>Subject:</b><span class="apple-converted-space"> </span>Re: [cfe-dev] OpenCL & SPIR specific types - proposal and patch</span><o:p></o:p></div></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "> <o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">I'm hoping to have comments on this patch tomorrow, but since I have proposed several patches to Clang for the sampler type (and have another in revision).. can you explain why you want to change the type from an integer to a pointer? <o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "> <o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">-Tanya<o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "> <o:p></o:p></div></div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; ">On Oct 3, 2012, at 8:06 AM, "Benyei, Guy" <<a href="mailto:guy.benyei@intel.com" style="color: blue; text-decoration: underline; "><span style="color: purple; ">guy.benyei@intel.com</span></a>> wrote:<o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><br><br><br><o:p></o:p></div></div><div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">I’d like to renew the discussion about making the OpenCL specific types first class citizens in Clang.</span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">I think this change is required by the OpenCL specifications, since these type names are keywords of the OpenCL C language.</span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">This change is also needed in order to enable efficient checking of OpenCL restrictions on these types (OpenCL 1.2 spec, section 6.9).</span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">Furthermore, the proposed change will turn these types to pointers to opaque types, which means that it will hide the actual (vendor specific) implementation, so the OpenCL vendors using Clang will be able to implement these types in their own way.</span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">This change would also be a basis for the implementation of SPIR generation by Clang. The SPIR discussion and spec can be found here:</span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-September/024132.html" style="color: blue; text-decoration: underline; "><span style="color: purple; ">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-September/024132.html</span></a></span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-September/024178.html" style="color: blue; text-decoration: underline; "><span style="color: purple; ">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-September/024178.html</span></a></span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; ">Earlier discussion about the OpenCL types was started by Anton Lokhmotov:</span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-May/015297.html" style="color: blue; text-decoration: underline; "><span style="color: purple; ">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-May/015297.html</span></a></span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-April/014741.html" style="color: blue; text-decoration: underline; "><span style="color: purple; ">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-April/014741.html</span></a></span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-March/014118.html" style="color: blue; text-decoration: underline; "><span style="color: purple; ">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-March/014118.html</span></a></span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-March/014121.html" style="color: blue; text-decoration: underline; "><span style="color: purple; ">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-March/014121.html</span></a></span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "><image001.png></span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; "> </span><o:p></o:p></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 13.5pt; font-family: Helvetica, sans-serif; "><opencl_types.patch></span><o:p></o:p></div></div><p style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 13.5pt; font-family: Helvetica, sans-serif; ">---------------------------------------------------------------------<br>Intel Israel (74) Limited</span><o:p></o:p></p><p style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 13.5pt; font-family: Helvetica, sans-serif; ">This e-mail and any attachments may contain confidential material for<br>the sole use of the intended recipient(s). Any review or distribution<br>by others is strictly prohibited. If you are not the intended<br>recipient, please contact the sender and delete all copies.</span><o:p></o:p></p><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><span style="font-size: 13.5pt; font-family: Helvetica, sans-serif; ">_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu" style="color: blue; text-decoration: underline; "><span style="color: purple; ">cfe-dev@cs.uiuc.edu</span></a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" style="color: blue; text-decoration: underline; "><span style="color: purple; ">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</span></a></span><o:p></o:p></div></div></div></div><div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "> <o:p></o:p></div></div></div></div></div><div style="margin-right: 0in; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; margin-top: 0in; margin-bottom: 0.0001pt; "><o:p> </o:p></div></div></div></div></span></blockquote></div><br></body></html>