[Clang][Driver] Disable llvm passes for the first host OpenMP offload compilation
authorSergey Dmitriev <serguei.n.dmitriev@intel.com>
Thu, 30 Jan 2020 18:14:16 +0000 (10:14 -0800)
committerSergey Dmitriev <serguei.n.dmitriev@intel.com>
Thu, 30 Jan 2020 18:16:41 +0000 (10:16 -0800)
commit36bfdb7096cfe1925448e408ec72f1a6bdc4cd2c
tree51d9693c5dda9bbf8c34cc673fd340b4c70f6174
parentc45bb326a681570b88dd315299c10c2242c143a9
[Clang][Driver] Disable llvm passes for the first host OpenMP offload compilation

Summary: With OpenMP offloading host compilation is done in two phases to capture host IR that is passed to all device compilations as input. But it turns out that we currently run entire LLVM optimization pipeline on host IR on both compilations which may have unpredictable effects on the resulting code. This patch fixes this problem by disabling LLVM passes on the first compilation, so the host IR that is passed to device compilations will be captured right after front end.

Reviewers: ABataev, jdoerfert, hfinkel

Reviewed By: ABataev

Subscribers: guansong, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73721
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/openmp-offload.c