[cfe-commits] r167647 - in /cfe/trunk: include/clang/Basic/BuiltinsNVPTX.def test/CodeGen/builtins-nvptx.c

Justin Holewinski justin.holewinski at gmail.com
Sat Nov 10 07:06:27 PST 2012


Blah, for some reason I was thinking "popc" == "sync". :(

membar should be "n".

Thanks for the catch!

Side question though: what does Clang actually do with the "const"
modifier?  The intrinsics are not marked as affecting memory, so the
optimizers should be be unaffected.


On Fri, Nov 9, 2012 at 4:02 PM, Eli Friedman <eli.friedman at gmail.com> wrote:

> On Fri, Nov 9, 2012 at 3:50 PM, Justin Holewinski
> <justin.holewinski at gmail.com> wrote:
> > Author: jholewinski
> > Date: Fri Nov  9 17:50:51 2012
> > New Revision: 167647
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=167647&view=rev
> > Log:
> > [NVPTX] Add __nvvm_* intrinsics as Clang builtins
> >
> > Fixes bug 13354.
> >
> > Modified:
> >     cfe/trunk/include/clang/Basic/BuiltinsNVPTX.def
> >     cfe/trunk/test/CodeGen/builtins-nvptx.c
> >
> > Modified: cfe/trunk/include/clang/Basic/BuiltinsNVPTX.def
> > URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsNVPTX.def?rev=167647&r1=167646&r2=167647&view=diff
> >
> ==============================================================================
> > --- cfe/trunk/include/clang/Basic/BuiltinsNVPTX.def (original)
> > +++ cfe/trunk/include/clang/Basic/BuiltinsNVPTX.def Fri Nov  9 17:50:51
> 2012
> > @@ -14,6 +14,7 @@
> >
> >  // The format of this database matches clang/Basic/Builtins.def.
> >
> > +// Builtins retained from previous PTX back-end
> >  BUILTIN(__builtin_ptx_read_tid_x, "i", "nc")
> >  BUILTIN(__builtin_ptx_read_tid_y, "i", "nc")
> >  BUILTIN(__builtin_ptx_read_tid_z, "i", "nc")
> > @@ -59,4 +60,249 @@
> >  BUILTIN(__builtin_ptx_bar_sync, "vi", "n")
> >
> >
> > +// Builtins exposed as part of NVVM
> > +BUILTIN(__syncthreads, "v", "nc")
> > +BUILTIN(__nvvm_bar0, "v", "nc")
> > +BUILTIN(__nvvm_bar0_popc, "ii", "nc")
> > +BUILTIN(__nvvm_bar0_and, "ii", "nc")
> > +BUILTIN(__nvvm_bar0_or, "ii", "nc")
> > +BUILTIN(__nvvm_membar_cta, "v", "n")
> > +BUILTIN(__nvvm_membar_gl, "v", "n")
> > +BUILTIN(__nvvm_membar_sys, "v", "n")
> > +BUILTIN(__nvvm_popc_i, "ii", "n")
> > +BUILTIN(__nvvm_popc_ll, "iLLi", "n")
>
> Shouldn't this be marked with "c" as well?   More generally, how
> carefully did you review this?
>
> -Eli
>



-- 

Thanks,

Justin Holewinski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121110/e86e1997/attachment.html>


More information about the cfe-commits mailing list