[PATCH] D68587: [hip] Assume host-only compilation if the final phase is ahead of `backend`.

Michael Liao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 7 13:29:56 PDT 2019


hliao added a comment.

In D68587#1698055 <https://reviews.llvm.org/D68587#1698055>, @tra wrote:

> I'm fine with this for -E/-M,
>
> I would argue that with `-fsyntax-only` we want to know whether our source code, which is common for all sub-compilations, has syntactic errors. 
>  The way we compile HIP & CUDA sources, some of the errors will only be reported on one side of the compilation. 
>  So, in order to make sure there are no syntax errors, we need to perform *all* sub-compilations with `-fsyntax-only`.
>
> E.g. it would be rather surprising to see the compilation succeeding with `-fsyntax-only`, but then fail with a syntax error somewhere on the device side during a real compilation.


for most compilation tools, single input and single output are expected. Without assuming `-fsyntax-only` alone is host-compilation only, that at least run syntax checking twice. The result may be misleading and there are clang-based tools (like clang-tidy) may have no legacy way to be runnable. To check device-side compilation syntax, we are still able to explicitly ask that by specifying `--cuda-device-only`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68587/new/

https://reviews.llvm.org/D68587





More information about the cfe-commits mailing list