[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-11-15 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL287012: [CUDA] Mark __libcpp_{isnan,isinf,isfinite} as constexpr. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25403?vs=77271&id=78041#toc Repository: rL LLVM https://rev

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-11-15 Thread Justin Lebar via cfe-commits
jlebar marked 6 inline comments as done. jlebar added a comment. Capturing an IRC conversation: > **EricWF** jlebar: Did you test this patch with older Clangs w/o constexpr > builtins? > **jlebar** EricWF, Do you mean, did I test the test, or did I test that the > non-test change does what I n

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-11-15 Thread Eric Fiselier via cfe-commits
EricWF added inline comments. Comment at: libcxx/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp:17 +// true constexpr-ness. + +#include jlebar wrote: > EricWF wrote: > > Does GCC offer these as contexpr? If not this needs a `// XFAIL: gcc` > Looks like the r

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-11-15 Thread Eric Fiselier via cfe-commits
EricWF added inline comments. Comment at: libcxx/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp:22 + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined jlebar wrote: > EricWF wrote: > > You don't need this `_LIBCPP_VERSION` check here. > Hm, there a

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-11-15 Thread Justin Lebar via cfe-commits
jlebar added a comment. Thanks for the review. Comment at: libcxx/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp:17 +// true constexpr-ness. + +#include EricWF wrote: > Does GCC offer these as contexpr? If not this needs a `// XFAIL: gcc` Looks like the re

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-11-15 Thread Eric Fiselier via cfe-commits
EricWF accepted this revision. EricWF added inline comments. This revision is now accepted and ready to land. Comment at: libcxx/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp:17 +// true constexpr-ness. + +#include Does GCC offer these as contexpr? If not t

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-11-08 Thread Hal Finkel via cfe-commits
hfinkel added a comment. In https://reviews.llvm.org/D25403#590049, @jlebar wrote: > Use TEST_STD_VER macro. This is fine with me; @EricWF , @mclow.lists ? https://reviews.llvm.org/D25403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-11-08 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 77271. jlebar added a comment. Use TEST_STD_VER macro. https://reviews.llvm.org/D25403 Files: libcxx/include/cmath libcxx/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp Index: libcxx/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp ==

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-11-08 Thread Hal Finkel via cfe-commits
hfinkel added inline comments. Comment at: libcxx/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp:24 + +#if __cplusplus >= 201103L +constexpr bool a = std::__libcpp_isnan(0.); I think the preferred form here is: #if TEST_STD_VER >= 11 https://reviews.llvm.o

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-11-07 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 77105. jlebar added a comment. Add a test. https://reviews.llvm.org/D25403 Files: libcxx/include/cmath libcxx/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp Index: libcxx/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp ==

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-11-07 Thread Justin Lebar via cfe-commits
jlebar added a comment. Hal, whadya think? https://reviews.llvm.org/D25403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-26 Thread Justin Lebar via cfe-commits
jlebar added a comment. So, good news -- these three builtins are already constexpr-evaluatable. :) I'll add a test. https://reviews.llvm.org/D25403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/list

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-26 Thread Hal Finkel via cfe-commits
hfinkel added a comment. In https://reviews.llvm.org/D25403#580444, @jlebar wrote: > //Let "CE" mean "constexpr-evaluatable". // > > libc++ attempts to be backwards-compatible with old versions of clang, right? Yea, we'd need to ifdef the test for older versions of Clang. I've just summarized

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-26 Thread Hal Finkel via cfe-commits
hfinkel added a comment. Here's what I suggest: 1. We commit this patch (I think it logically makes sense; the builtins should be constexpr evaluatable, even if they're currently not) 2. We follow up by fixing Clang to make the builtins constexpr evaluatable (since I think that makes sense rega

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-26 Thread Justin Lebar via cfe-commits
jlebar added a comment. //Let "CE" mean "constexpr-evaluatable". // libc++ attempts to be backwards-compatible with old versions of clang, right? Old versions of clang are going to fail, since the builtin will not be CE. Is the idea to write a test that checks that, if __builtin_isfinite is C

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-26 Thread Hal Finkel via cfe-commits
hfinkel added a comment. In https://reviews.llvm.org/D25403#580439, @jlebar wrote: > > I'm not sure about that. It seems like a useful feature for the builtins to > > have. Logically speaking, they should be constexpr. > > I agree that it's logically correct for the builtins to be > constexpr-e

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-26 Thread Justin Lebar via cfe-commits
jlebar added a comment. > I'm not sure about that. It seems like a useful feature for the builtins to > have. Logically speaking, they should be constexpr. I agree that it's logically correct for the builtins to be constexpr-evaluatable. My point is just that doing this work and then writing

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-26 Thread Hal Finkel via cfe-commits
hfinkel added a comment. In https://reviews.llvm.org/D25403#580432, @jlebar wrote: > In https://reviews.llvm.org/D25403#580422, @hfinkel wrote: > > > Okay. Why not fix the Clang builtins so that they're evaluatable for > > constant inputs in a constexpr context? Then we can do this and test the

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-26 Thread Justin Lebar via cfe-commits
jlebar added a comment. In https://reviews.llvm.org/D25403#580422, @hfinkel wrote: > Okay. Why not fix the Clang builtins so that they're evaluatable for constant > inputs in a constexpr context? Then we can do this and test the change. I am not sure how much value we would derive from testing

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-26 Thread Hal Finkel via cfe-commits
hfinkel added a comment. In https://reviews.llvm.org/D25403#580416, @jlebar wrote: > > Is this because the functions are in instead of in are > > you don't want to mark all of as host/device? > > Yes. cmath is its own beast; we need to have our own implementation of it in > order to direct

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-26 Thread Justin Lebar via cfe-commits
jlebar added a comment. > Is this because the functions are in instead of in are you > don't want to mark all of as host/device? Yes. cmath is its own beast; we need to have our own implementation of it in order to direct the std functions to the appropriate low-level device functions. (A

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-26 Thread Hal Finkel via cfe-commits
hfinkel added a comment. ... > > >> I guess I don't understand the motivation for this change. > > To make work in CUDA, we do the following terrible, awful, > horrible, no good thing: ...well, I can just show you the code. > https://github.com/llvm-project/llvm-project/blob/master/clang/l

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-23 Thread Justin Lebar via cfe-commits
jlebar added a comment. Friendly ping? https://reviews.llvm.org/D25403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-18 Thread Justin Lebar via cfe-commits
jlebar added a comment. In https://reviews.llvm.org/D25403#573666, @mclow.lists wrote: > Yesterday and today is the first time in a while that clang has been > seriously broken for more than an hour or so. > I'm not inclined to worry about it yet. Oh, awesome. That sounds good to me. The qu

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-18 Thread Marshall Clow via cfe-commits
mclow.lists added a comment. In https://reviews.llvm.org/D25403#573104, @jlebar wrote: > Likewise, should I update the documentation to indicate that check-cxx may > fail with a clang built from tip of tree, due to c++17 support being > experimental? Or do you all want to change the target so

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-18 Thread Justin Lebar via cfe-commits
jlebar added a comment. Thank you, Marshall. In https://reviews.llvm.org/D25403#572998, @mclow.lists wrote: > My build setup is similar to yours (on Mac OS X): > > cd $LLVM_BUILD ; rm -rf libcxx ; mkdir libcxx ; cd libcxx > CXX=$LLVM_BIN/clang++ cmake -DLLVM_PATH=$LLVM/llvm > -DLIBCXX_CXX_

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-18 Thread Marshall Clow via cfe-commits
mclow.lists added a comment. > error: undefined reference to '__gxx_personality_v0' means that you're not linking to an ABI library. That symbol comes out of libc++abi, but you can also get that from libsupc. My build setup is similar to yours (on Mac OS X): cd $LLVM_BUILD ; rm -rf libcxx ;

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-17 Thread Justin Lebar via cfe-commits
jlebar added a comment. > The tests should be runnable with lit. I generally just do an in-tree build > and run make check-libcxx. @EricWF , what's the recommended way of running > the tests from an out-of-tree build? Things seem broken at the moment with clang from tip of tree. I did a clean

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-10 Thread Hal Finkel via cfe-commits
hfinkel added a comment. In https://reviews.llvm.org/D25403#565603, @jlebar wrote: > Although these pass the CUDA test-suite tests (which I haven't yet committed > because they're broken without this change), I could use some help running > the libcxx tests. > > I cannot find any documentation

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar added a comment. Although these pass the CUDA test-suite tests (which I haven't yet committed because they're broken without this change), I could use some help running the libcxx tests. I cannot find any documentation explaining how to run the libcxx tests with just-built clang. Presu

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: hfinkel. jlebar added a subscriber: cfe-commits. This makes these functions available on host and device, which is necessary to compile for the device. https://reviews.llvm.org/D25403 Files: libcxx/include/cmath Index: libcxx/include/c