[PATCH] D112410: [SPIR-V] Add a toolchain for SPIR-V in clang

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 16 05:33:35 PST 2021


Anastasia added a comment.

In D112410#3197441 <https://reviews.llvm.org/D112410#3197441>, @linjamaki wrote:

> If I understand correctly, the default optimization level is `-O2` for the OpenCL and OpenCL++ language mode (according to CompilerInvocation.cpp:getOptimizationLevel()). Since higher than `-O0` may not work with the translator, should the SPIR-V tool chain override this default and set it to -O0 (unless a user passes some -O option)?

We could do that, although I also find it a bit confusing if one target behaves differently from the rest. I believe `-O2` is clang's default, not specific to a particular language...

Also I have an impression that translating optimised IR mostly works.

And another aspect to consider is that we are also integrating the SPIR-V backend in parallel which should be supporting the optimizations fully. So I would prefer not to tailor the clang architecture to the use of the translator too much as it is only a temporary solution...


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

https://reviews.llvm.org/D112410



More information about the cfe-commits mailing list