[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-09 Thread Steven Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL317860: [Driver] Make clang/cc conforms to UNIX standard (authored by steven_wu). Repository: rL LLVM https://reviews.llvm.org/D39502 Files: cfe/trunk/lib/Driver/Compilation.cpp cfe/trunk/test/Dri

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-09 Thread Artem Belevich via Phabricator via cfe-commits
tra accepted this revision. tra added a comment. This revision is now accepted and ready to land. LGTM for CUDA-related functionality & tests. Thank you for the patch! https://reviews.llvm.org/D39502 ___ cfe-commits mailing list cfe-commits@lists.ll

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-09 Thread Steven Wu via Phabricator via cfe-commits
steven_wu updated this revision to Diff 122376. steven_wu added a comment. Add more tests! The new tests can trigger two errors during the compilation but only one should be emitted. https://reviews.llvm.org/D39502 Files: lib/Driver/Compilation.cpp test/Driver/cuda-bail-out.cu test/Driver

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-09 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: test/Driver/cuda-bail-out.cu:47 +// CHECK-HOST-ERROR: Error during compilation for host +// CHECK-HOST-ERROR-NOT: Error during compilation for sm_35 steven_wu wrote: > tra wrote: > > steven_wu wrote: > > > tra wrote: > > > >

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-09 Thread Steven Wu via Phabricator via cfe-commits
steven_wu updated this revision to Diff 122372. steven_wu added a comment. I think I understand what you mean now. You want some cases when the compilation doesn't failed on the first source it process. I add a testcase which compiles for host + sm_35 + sim_60. I run the test 3 times and each tim

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-09 Thread Steven Wu via Phabricator via cfe-commits
steven_wu added inline comments. Comment at: test/Driver/cuda-bail-out.cu:47 +// CHECK-HOST-ERROR: Error during compilation for host +// CHECK-HOST-ERROR-NOT: Error during compilation for sm_35 tra wrote: > steven_wu wrote: > > tra wrote: > > > steven_wu wrote: >

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-09 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: test/Driver/cuda-bail-out.cu:47 +// CHECK-HOST-ERROR: Error during compilation for host +// CHECK-HOST-ERROR-NOT: Error during compilation for sm_35 steven_wu wrote: > tra wrote: > > steven_wu wrote: > > > tra wrote: > > > >

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-09 Thread Justin Lebar via Phabricator via cfe-commits
jlebar added a comment. I abdicate as a reviewer in favor of tra -- if he's happy, I'm happy. https://reviews.llvm.org/D39502 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-06 Thread Steven Wu via Phabricator via cfe-commits
steven_wu updated this revision to Diff 121822. steven_wu added a comment. Update testcase for CUDA driver https://reviews.llvm.org/D39502 Files: lib/Driver/Compilation.cpp test/Driver/cuda-bail-out.cu test/Driver/output-file-cleanup.c test/Driver/unix-conformance.c Index: test/Driver/

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-06 Thread Steven Wu via Phabricator via cfe-commits
steven_wu added inline comments. Comment at: test/Driver/cuda-bail-out.cu:47 +// CHECK-HOST-ERROR: Error during compilation for host +// CHECK-HOST-ERROR-NOT: Error during compilation for sm_35 tra wrote: > steven_wu wrote: > > tra wrote: > > > To make it more ro

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-06 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: test/Driver/cuda-bail-out.cu:47 +// CHECK-HOST-ERROR: Error during compilation for host +// CHECK-HOST-ERROR-NOT: Error during compilation for sm_35 steven_wu wrote: > tra wrote: > > To make it more robust, I'd add another c

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-06 Thread Steven Wu via Phabricator via cfe-commits
steven_wu added inline comments. Comment at: test/Driver/cuda-bail-out.cu:47 +// CHECK-HOST-ERROR: Error during compilation for host +// CHECK-HOST-ERROR-NOT: Error during compilation for sm_35 tra wrote: > To make it more robust, I'd add another copy of the last

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-06 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In https://reviews.llvm.org/D39502#917267, @steven_wu wrote: > Improve testcase according to review feedback. > > In order to let compilation to be successful for one input, I need to use > -fsyntax-only because I don't have nvptx assembler. Enable -fsyntax-only > changes t

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-06 Thread Steven Wu via Phabricator via cfe-commits
steven_wu updated this revision to Diff 121807. steven_wu added a comment. Improve testcase according to review feedback. In order to let compilation to be successful for one input, I need to use -fsyntax-only because I don't have nvptx assembler. Enable -fsyntax-only changes the order of the com

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-06 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: test/Driver/cuda-bail-out.cu:31 +// CHECK-TWO-ARCHES-NOT: Error during compilation for sm_60 +// CHECK-TWO-ARCHES-NOT Error during host compilation Missing ':' after CHECK-TWO-ARCHES-NOT. You may want to include a compilati

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-06 Thread Steven Wu via Phabricator via cfe-commits
steven_wu added a comment. In https://reviews.llvm.org/D39502#917132, @tra wrote: > In https://reviews.llvm.org/D39502#917097, @steven_wu wrote: > > > Also, the reason I don't know how to craft a testcase is not because I have > > trouble with CUDA driver, but how to write a test to check when d

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-06 Thread Steven Wu via Phabricator via cfe-commits
steven_wu updated this revision to Diff 121795. steven_wu added a comment. Add testcase for CUDA driver https://reviews.llvm.org/D39502 Files: lib/Driver/Compilation.cpp test/Driver/cuda-bail-out.cu test/Driver/output-file-cleanup.c test/Driver/unix-conformance.c Index: test/Driver/uni

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-06 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. In https://reviews.llvm.org/D39502#917097, @steven_wu wrote: > Also, the reason I don't know how to craft a testcase is not because I have > trouble with CUDA driver, but how to write a test to check when did the > driver > bailed out. Let me know if you have any suggestio

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-06 Thread Steven Wu via Phabricator via cfe-commits
steven_wu updated this revision to Diff 121779. steven_wu added a comment. This seems to be the cleanest solution I can find for CUDA without touching the job configuration for CUDA. My proposed fix is to bail out of the jobs that are parts of CUDA offload if some command failed before that. Now i

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-06 Thread Steven Wu via Phabricator via cfe-commits
steven_wu added a comment. In https://reviews.llvm.org/D39502#916409, @jlebar wrote: > > Note the host clang side has the inputs "test.cu" and "test-c3378c.fatbin". > > Which means if the device side compilation failed, the host side will not > > compile because InputOk will return false in thi

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-05 Thread Justin Lebar via Phabricator via cfe-commits
jlebar requested changes to this revision. jlebar added a comment. This revision now requires changes to proceed. > Note the host clang side has the inputs "test.cu" and "test-c3378c.fatbin". > Which means if the device side compilation failed, the host side will not > compile because InputOk wi

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-02 Thread Steven Wu via Phabricator via cfe-commits
steven_wu updated this revision to Diff 121410. steven_wu added a comment. Fix testcase. My test was passing because files left over from previous run. Now it should work with a clean build. https://reviews.llvm.org/D39502 Files: lib/Driver/Compilation.cpp test/Driver/output-file-cleanup.c

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-02 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. In https://reviews.llvm.org/D39502#914667, @steven_wu wrote: > Also split out the testcase for UNIX conformance. That test is not related > to output file cleanup. Split it out to make it clear that is for UNIX > conformance. Great idea. Confirming this LGTM once

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-02 Thread Steven Wu via Phabricator via cfe-commits
steven_wu updated this revision to Diff 121403. steven_wu added a comment. Address review feedback. Also split out the testcase for UNIX conformance. That test is not related to output file cleanup. Split it out to make it clear that is for UNIX conformance. https://reviews.llvm.org/D39502 Fil

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-01 Thread Duncan P. N. Exon Smith via Phabricator via cfe-commits
dexonsmith added a comment. I have a few nitpicks, but otherwise this LGTM. I'd like to wait for someone on the CUDA side to confirm though. Comment at: lib/Driver/Compilation.cpp:185 -void Compilation::ExecuteJobs( -const JobList &Jobs, -SmallVectorImpl> &FailingCo

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-01 Thread Steven Wu via Phabricator via cfe-commits
steven_wu added a comment. More background here that doesn't fit in the commit message. The tweak for cl mode is intended for r262420. I don't see any test breakage on my machine without that hack but I leave it in there just in case. A little reasoning behind clang driver for CUDA. This is wha

[PATCH] D39502: [Driver] Make clang/cc conforms to UNIX standard

2017-11-01 Thread Steven Wu via Phabricator via cfe-commits
steven_wu created this revision. This is basically reverting r261774 with a tweak for clang-cl. UNIX standard states: When c99 encounters a compilation error that causes an object file not to be created, it shall write a diagnostic to standard error and continue to compile other source code operan